diff --git a/vendor/github.com/DataDog/zstd/cpu.h b/vendor/github.com/DataDog/zstd/cpu.h
old mode 100755
new mode 100644
diff --git a/vendor/github.com/DataDog/zstd/travis_test_32.sh b/vendor/github.com/DataDog/zstd/travis_test_32.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/DataDog/zstd/zstdmt_compress.c b/vendor/github.com/DataDog/zstd/zstdmt_compress.c
old mode 100755
new mode 100644
diff --git a/vendor/github.com/DataDog/zstd/zstdmt_compress.h b/vendor/github.com/DataDog/zstd/zstdmt_compress.h
old mode 100755
new mode 100644
diff --git a/vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS b/vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS
deleted file mode 100644
index b368efb..0000000
--- a/vendor/github.com/gogo/protobuf/GOLANG_CONTRIBUTORS
+++ /dev/null
@@ -1,5 +0,0 @@
-The contributors to the Go protobuf repository:
-
-# This source code was written by the Go contributors.
-# The master list of contributors is in the main Go distribution,
-# visible at http://tip.golang.org/CONTRIBUTORS.
\ No newline at end of file
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go
deleted file mode 100644
index 0d6055d..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/doc.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
-	A plugin for the Google protocol buffer compiler to generate Go code.
-	Run it by building this program and putting it in your path with the name
-		protoc-gen-go
-	That word 'go' at the end becomes part of the option string set for the
-	protocol compiler, so once the protocol compiler (protoc) is installed
-	you can run
-		protoc --go_out=output_directory input_directory/file.proto
-	to generate Go bindings for the protocol defined by file.proto.
-	With that input, the output will be written to
-		output_directory/file.pb.go
-
-	The generated code is documented in the package comment for
-	the library.
-
-	See the README and documentation for protocol buffers to learn more:
-		https://developers.google.com/protocol-buffers/
-
-*/
-package documentation
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
deleted file mode 100644
index 6f4a902..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/generator.go
+++ /dev/null
@@ -1,2806 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
-	The code generator for the plugin for the Google protocol buffer compiler.
-	It generates Go code from the protocol buffer description files read by the
-	main routine.
-*/
-package generator
-
-import (
-	"bufio"
-	"bytes"
-	"compress/gzip"
-	"crypto/sha256"
-	"encoding/hex"
-	"fmt"
-	"go/ast"
-	"go/build"
-	"go/parser"
-	"go/printer"
-	"go/token"
-	"log"
-	"os"
-	"path"
-	"sort"
-	"strconv"
-	"strings"
-	"unicode"
-	"unicode/utf8"
-
-	"github.com/golang/protobuf/proto"
-	"github.com/golang/protobuf/protoc-gen-go/generator/internal/remap"
-
-	"github.com/golang/protobuf/protoc-gen-go/descriptor"
-	plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
-)
-
-// generatedCodeVersion indicates a version of the generated code.
-// It is incremented whenever an incompatibility between the generated code and
-// proto package is introduced; the generated code references
-// a constant, proto.ProtoPackageIsVersionN (where N is generatedCodeVersion).
-const generatedCodeVersion = 3
-
-// A Plugin provides functionality to add to the output during Go code generation,
-// such as to produce RPC stubs.
-type Plugin interface {
-	// Name identifies the plugin.
-	Name() string
-	// Init is called once after data structures are built but before
-	// code generation begins.
-	Init(g *Generator)
-	// Generate produces the code generated by the plugin for this file,
-	// except for the imports, by calling the generator's methods P, In, and Out.
-	Generate(file *FileDescriptor)
-	// GenerateImports produces the import declarations for this file.
-	// It is called after Generate.
-	GenerateImports(file *FileDescriptor)
-}
-
-var plugins []Plugin
-
-// RegisterPlugin installs a (second-order) plugin to be run when the Go output is generated.
-// It is typically called during initialization.
-func RegisterPlugin(p Plugin) {
-	plugins = append(plugins, p)
-}
-
-// A GoImportPath is the import path of a Go package. e.g., "google.golang.org/genproto/protobuf".
-type GoImportPath string
-
-func (p GoImportPath) String() string { return strconv.Quote(string(p)) }
-
-// A GoPackageName is the name of a Go package. e.g., "protobuf".
-type GoPackageName string
-
-// Each type we import as a protocol buffer (other than FileDescriptorProto) needs
-// a pointer to the FileDescriptorProto that represents it.  These types achieve that
-// wrapping by placing each Proto inside a struct with the pointer to its File. The
-// structs have the same names as their contents, with "Proto" removed.
-// FileDescriptor is used to store the things that it points to.
-
-// The file and package name method are common to messages and enums.
-type common struct {
-	file *FileDescriptor // File this object comes from.
-}
-
-// GoImportPath is the import path of the Go package containing the type.
-func (c *common) GoImportPath() GoImportPath {
-	return c.file.importPath
-}
-
-func (c *common) File() *FileDescriptor { return c.file }
-
-func fileIsProto3(file *descriptor.FileDescriptorProto) bool {
-	return file.GetSyntax() == "proto3"
-}
-
-func (c *common) proto3() bool { return fileIsProto3(c.file.FileDescriptorProto) }
-
-// Descriptor represents a protocol buffer message.
-type Descriptor struct {
-	common
-	*descriptor.DescriptorProto
-	parent   *Descriptor            // The containing message, if any.
-	nested   []*Descriptor          // Inner messages, if any.
-	enums    []*EnumDescriptor      // Inner enums, if any.
-	ext      []*ExtensionDescriptor // Extensions, if any.
-	typename []string               // Cached typename vector.
-	index    int                    // The index into the container, whether the file or another message.
-	path     string                 // The SourceCodeInfo path as comma-separated integers.
-	group    bool
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (d *Descriptor) TypeName() []string {
-	if d.typename != nil {
-		return d.typename
-	}
-	n := 0
-	for parent := d; parent != nil; parent = parent.parent {
-		n++
-	}
-	s := make([]string, n)
-	for parent := d; parent != nil; parent = parent.parent {
-		n--
-		s[n] = parent.GetName()
-	}
-	d.typename = s
-	return s
-}
-
-// EnumDescriptor describes an enum. If it's at top level, its parent will be nil.
-// Otherwise it will be the descriptor of the message in which it is defined.
-type EnumDescriptor struct {
-	common
-	*descriptor.EnumDescriptorProto
-	parent   *Descriptor // The containing message, if any.
-	typename []string    // Cached typename vector.
-	index    int         // The index into the container, whether the file or a message.
-	path     string      // The SourceCodeInfo path as comma-separated integers.
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (e *EnumDescriptor) TypeName() (s []string) {
-	if e.typename != nil {
-		return e.typename
-	}
-	name := e.GetName()
-	if e.parent == nil {
-		s = make([]string, 1)
-	} else {
-		pname := e.parent.TypeName()
-		s = make([]string, len(pname)+1)
-		copy(s, pname)
-	}
-	s[len(s)-1] = name
-	e.typename = s
-	return s
-}
-
-// Everything but the last element of the full type name, CamelCased.
-// The values of type Foo.Bar are call Foo_value1... not Foo_Bar_value1... .
-func (e *EnumDescriptor) prefix() string {
-	if e.parent == nil {
-		// If the enum is not part of a message, the prefix is just the type name.
-		return CamelCase(*e.Name) + "_"
-	}
-	typeName := e.TypeName()
-	return CamelCaseSlice(typeName[0:len(typeName)-1]) + "_"
-}
-
-// The integer value of the named constant in this enumerated type.
-func (e *EnumDescriptor) integerValueAsString(name string) string {
-	for _, c := range e.Value {
-		if c.GetName() == name {
-			return fmt.Sprint(c.GetNumber())
-		}
-	}
-	log.Fatal("cannot find value for enum constant")
-	return ""
-}
-
-// ExtensionDescriptor describes an extension. If it's at top level, its parent will be nil.
-// Otherwise it will be the descriptor of the message in which it is defined.
-type ExtensionDescriptor struct {
-	common
-	*descriptor.FieldDescriptorProto
-	parent *Descriptor // The containing message, if any.
-}
-
-// TypeName returns the elements of the dotted type name.
-// The package name is not part of this name.
-func (e *ExtensionDescriptor) TypeName() (s []string) {
-	name := e.GetName()
-	if e.parent == nil {
-		// top-level extension
-		s = make([]string, 1)
-	} else {
-		pname := e.parent.TypeName()
-		s = make([]string, len(pname)+1)
-		copy(s, pname)
-	}
-	s[len(s)-1] = name
-	return s
-}
-
-// DescName returns the variable name used for the generated descriptor.
-func (e *ExtensionDescriptor) DescName() string {
-	// The full type name.
-	typeName := e.TypeName()
-	// Each scope of the extension is individually CamelCased, and all are joined with "_" with an "E_" prefix.
-	for i, s := range typeName {
-		typeName[i] = CamelCase(s)
-	}
-	return "E_" + strings.Join(typeName, "_")
-}
-
-// ImportedDescriptor describes a type that has been publicly imported from another file.
-type ImportedDescriptor struct {
-	common
-	o Object
-}
-
-func (id *ImportedDescriptor) TypeName() []string { return id.o.TypeName() }
-
-// FileDescriptor describes an protocol buffer descriptor file (.proto).
-// It includes slices of all the messages and enums defined within it.
-// Those slices are constructed by WrapTypes.
-type FileDescriptor struct {
-	*descriptor.FileDescriptorProto
-	desc []*Descriptor          // All the messages defined in this file.
-	enum []*EnumDescriptor      // All the enums defined in this file.
-	ext  []*ExtensionDescriptor // All the top-level extensions defined in this file.
-	imp  []*ImportedDescriptor  // All types defined in files publicly imported by this file.
-
-	// Comments, stored as a map of path (comma-separated integers) to the comment.
-	comments map[string]*descriptor.SourceCodeInfo_Location
-
-	// The full list of symbols that are exported,
-	// as a map from the exported object to its symbols.
-	// This is used for supporting public imports.
-	exported map[Object][]symbol
-
-	importPath  GoImportPath  // Import path of this file's package.
-	packageName GoPackageName // Name of this file's Go package.
-
-	proto3 bool // whether to generate proto3 code for this file
-}
-
-// VarName is the variable name we'll use in the generated code to refer
-// to the compressed bytes of this descriptor. It is not exported, so
-// it is only valid inside the generated package.
-func (d *FileDescriptor) VarName() string {
-	h := sha256.Sum256([]byte(d.GetName()))
-	return fmt.Sprintf("fileDescriptor_%s", hex.EncodeToString(h[:8]))
-}
-
-// goPackageOption interprets the file's go_package option.
-// If there is no go_package, it returns ("", "", false).
-// If there's a simple name, it returns ("", pkg, true).
-// If the option implies an import path, it returns (impPath, pkg, true).
-func (d *FileDescriptor) goPackageOption() (impPath GoImportPath, pkg GoPackageName, ok bool) {
-	opt := d.GetOptions().GetGoPackage()
-	if opt == "" {
-		return "", "", false
-	}
-	// A semicolon-delimited suffix delimits the import path and package name.
-	sc := strings.Index(opt, ";")
-	if sc >= 0 {
-		return GoImportPath(opt[:sc]), cleanPackageName(opt[sc+1:]), true
-	}
-	// The presence of a slash implies there's an import path.
-	slash := strings.LastIndex(opt, "/")
-	if slash >= 0 {
-		return GoImportPath(opt), cleanPackageName(opt[slash+1:]), true
-	}
-	return "", cleanPackageName(opt), true
-}
-
-// goFileName returns the output name for the generated Go file.
-func (d *FileDescriptor) goFileName(pathType pathType) string {
-	name := *d.Name
-	if ext := path.Ext(name); ext == ".proto" || ext == ".protodevel" {
-		name = name[:len(name)-len(ext)]
-	}
-	name += ".pb.go"
-
-	if pathType == pathTypeSourceRelative {
-		return name
-	}
-
-	// Does the file have a "go_package" option?
-	// If it does, it may override the filename.
-	if impPath, _, ok := d.goPackageOption(); ok && impPath != "" {
-		// Replace the existing dirname with the declared import path.
-		_, name = path.Split(name)
-		name = path.Join(string(impPath), name)
-		return name
-	}
-
-	return name
-}
-
-func (d *FileDescriptor) addExport(obj Object, sym symbol) {
-	d.exported[obj] = append(d.exported[obj], sym)
-}
-
-// symbol is an interface representing an exported Go symbol.
-type symbol interface {
-	// GenerateAlias should generate an appropriate alias
-	// for the symbol from the named package.
-	GenerateAlias(g *Generator, filename string, pkg GoPackageName)
-}
-
-type messageSymbol struct {
-	sym                         string
-	hasExtensions, isMessageSet bool
-	oneofTypes                  []string
-}
-
-type getterSymbol struct {
-	name     string
-	typ      string
-	typeName string // canonical name in proto world; empty for proto.Message and similar
-	genType  bool   // whether typ contains a generated type (message/group/enum)
-}
-
-func (ms *messageSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
-	g.P("// ", ms.sym, " from public import ", filename)
-	g.P("type ", ms.sym, " = ", pkg, ".", ms.sym)
-	for _, name := range ms.oneofTypes {
-		g.P("type ", name, " = ", pkg, ".", name)
-	}
-}
-
-type enumSymbol struct {
-	name   string
-	proto3 bool // Whether this came from a proto3 file.
-}
-
-func (es enumSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
-	s := es.name
-	g.P("// ", s, " from public import ", filename)
-	g.P("type ", s, " = ", pkg, ".", s)
-	g.P("var ", s, "_name = ", pkg, ".", s, "_name")
-	g.P("var ", s, "_value = ", pkg, ".", s, "_value")
-}
-
-type constOrVarSymbol struct {
-	sym  string
-	typ  string // either "const" or "var"
-	cast string // if non-empty, a type cast is required (used for enums)
-}
-
-func (cs constOrVarSymbol) GenerateAlias(g *Generator, filename string, pkg GoPackageName) {
-	v := string(pkg) + "." + cs.sym
-	if cs.cast != "" {
-		v = cs.cast + "(" + v + ")"
-	}
-	g.P(cs.typ, " ", cs.sym, " = ", v)
-}
-
-// Object is an interface abstracting the abilities shared by enums, messages, extensions and imported objects.
-type Object interface {
-	GoImportPath() GoImportPath
-	TypeName() []string
-	File() *FileDescriptor
-}
-
-// Generator is the type whose methods generate the output, stored in the associated response structure.
-type Generator struct {
-	*bytes.Buffer
-
-	Request  *plugin.CodeGeneratorRequest  // The input.
-	Response *plugin.CodeGeneratorResponse // The output.
-
-	Param             map[string]string // Command-line parameters.
-	PackageImportPath string            // Go import path of the package we're generating code for
-	ImportPrefix      string            // String to prefix to imported package file names.
-	ImportMap         map[string]string // Mapping from .proto file name to import path
-
-	Pkg map[string]string // The names under which we import support packages
-
-	outputImportPath GoImportPath                   // Package we're generating code for.
-	allFiles         []*FileDescriptor              // All files in the tree
-	allFilesByName   map[string]*FileDescriptor     // All files by filename.
-	genFiles         []*FileDescriptor              // Those files we will generate output for.
-	file             *FileDescriptor                // The file we are compiling now.
-	packageNames     map[GoImportPath]GoPackageName // Imported package names in the current file.
-	usedPackages     map[GoImportPath]bool          // Packages used in current file.
-	usedPackageNames map[GoPackageName]bool         // Package names used in the current file.
-	addedImports     map[GoImportPath]bool          // Additional imports to emit.
-	typeNameToObject map[string]Object              // Key is a fully-qualified name in input syntax.
-	init             []string                       // Lines to emit in the init function.
-	indent           string
-	pathType         pathType // How to generate output filenames.
-	writeOutput      bool
-	annotateCode     bool                                       // whether to store annotations
-	annotations      []*descriptor.GeneratedCodeInfo_Annotation // annotations to store
-}
-
-type pathType int
-
-const (
-	pathTypeImport pathType = iota
-	pathTypeSourceRelative
-)
-
-// New creates a new generator and allocates the request and response protobufs.
-func New() *Generator {
-	g := new(Generator)
-	g.Buffer = new(bytes.Buffer)
-	g.Request = new(plugin.CodeGeneratorRequest)
-	g.Response = new(plugin.CodeGeneratorResponse)
-	return g
-}
-
-// Error reports a problem, including an error, and exits the program.
-func (g *Generator) Error(err error, msgs ...string) {
-	s := strings.Join(msgs, " ") + ":" + err.Error()
-	log.Print("protoc-gen-go: error:", s)
-	os.Exit(1)
-}
-
-// Fail reports a problem and exits the program.
-func (g *Generator) Fail(msgs ...string) {
-	s := strings.Join(msgs, " ")
-	log.Print("protoc-gen-go: error:", s)
-	os.Exit(1)
-}
-
-// CommandLineParameters breaks the comma-separated list of key=value pairs
-// in the parameter (a member of the request protobuf) into a key/value map.
-// It then sets file name mappings defined by those entries.
-func (g *Generator) CommandLineParameters(parameter string) {
-	g.Param = make(map[string]string)
-	for _, p := range strings.Split(parameter, ",") {
-		if i := strings.Index(p, "="); i < 0 {
-			g.Param[p] = ""
-		} else {
-			g.Param[p[0:i]] = p[i+1:]
-		}
-	}
-
-	g.ImportMap = make(map[string]string)
-	pluginList := "none" // Default list of plugin names to enable (empty means all).
-	for k, v := range g.Param {
-		switch k {
-		case "import_prefix":
-			g.ImportPrefix = v
-		case "import_path":
-			g.PackageImportPath = v
-		case "paths":
-			switch v {
-			case "import":
-				g.pathType = pathTypeImport
-			case "source_relative":
-				g.pathType = pathTypeSourceRelative
-			default:
-				g.Fail(fmt.Sprintf(`Unknown path type %q: want "import" or "source_relative".`, v))
-			}
-		case "plugins":
-			pluginList = v
-		case "annotate_code":
-			if v == "true" {
-				g.annotateCode = true
-			}
-		default:
-			if len(k) > 0 && k[0] == 'M' {
-				g.ImportMap[k[1:]] = v
-			}
-		}
-	}
-	if pluginList != "" {
-		// Amend the set of plugins.
-		enabled := make(map[string]bool)
-		for _, name := range strings.Split(pluginList, "+") {
-			enabled[name] = true
-		}
-		var nplugins []Plugin
-		for _, p := range plugins {
-			if enabled[p.Name()] {
-				nplugins = append(nplugins, p)
-			}
-		}
-		plugins = nplugins
-	}
-}
-
-// DefaultPackageName returns the package name printed for the object.
-// If its file is in a different package, it returns the package name we're using for this file, plus ".".
-// Otherwise it returns the empty string.
-func (g *Generator) DefaultPackageName(obj Object) string {
-	importPath := obj.GoImportPath()
-	if importPath == g.outputImportPath {
-		return ""
-	}
-	return string(g.GoPackageName(importPath)) + "."
-}
-
-// GoPackageName returns the name used for a package.
-func (g *Generator) GoPackageName(importPath GoImportPath) GoPackageName {
-	if name, ok := g.packageNames[importPath]; ok {
-		return name
-	}
-	name := cleanPackageName(baseName(string(importPath)))
-	for i, orig := 1, name; g.usedPackageNames[name] || isGoPredeclaredIdentifier[string(name)]; i++ {
-		name = orig + GoPackageName(strconv.Itoa(i))
-	}
-	g.packageNames[importPath] = name
-	g.usedPackageNames[name] = true
-	return name
-}
-
-// AddImport adds a package to the generated file's import section.
-// It returns the name used for the package.
-func (g *Generator) AddImport(importPath GoImportPath) GoPackageName {
-	g.addedImports[importPath] = true
-	return g.GoPackageName(importPath)
-}
-
-var globalPackageNames = map[GoPackageName]bool{
-	"fmt":   true,
-	"math":  true,
-	"proto": true,
-}
-
-// Create and remember a guaranteed unique package name. Pkg is the candidate name.
-// The FileDescriptor parameter is unused.
-func RegisterUniquePackageName(pkg string, f *FileDescriptor) string {
-	name := cleanPackageName(pkg)
-	for i, orig := 1, name; globalPackageNames[name]; i++ {
-		name = orig + GoPackageName(strconv.Itoa(i))
-	}
-	globalPackageNames[name] = true
-	return string(name)
-}
-
-var isGoKeyword = map[string]bool{
-	"break":       true,
-	"case":        true,
-	"chan":        true,
-	"const":       true,
-	"continue":    true,
-	"default":     true,
-	"else":        true,
-	"defer":       true,
-	"fallthrough": true,
-	"for":         true,
-	"func":        true,
-	"go":          true,
-	"goto":        true,
-	"if":          true,
-	"import":      true,
-	"interface":   true,
-	"map":         true,
-	"package":     true,
-	"range":       true,
-	"return":      true,
-	"select":      true,
-	"struct":      true,
-	"switch":      true,
-	"type":        true,
-	"var":         true,
-}
-
-var isGoPredeclaredIdentifier = map[string]bool{
-	"append":     true,
-	"bool":       true,
-	"byte":       true,
-	"cap":        true,
-	"close":      true,
-	"complex":    true,
-	"complex128": true,
-	"complex64":  true,
-	"copy":       true,
-	"delete":     true,
-	"error":      true,
-	"false":      true,
-	"float32":    true,
-	"float64":    true,
-	"imag":       true,
-	"int":        true,
-	"int16":      true,
-	"int32":      true,
-	"int64":      true,
-	"int8":       true,
-	"iota":       true,
-	"len":        true,
-	"make":       true,
-	"new":        true,
-	"nil":        true,
-	"panic":      true,
-	"print":      true,
-	"println":    true,
-	"real":       true,
-	"recover":    true,
-	"rune":       true,
-	"string":     true,
-	"true":       true,
-	"uint":       true,
-	"uint16":     true,
-	"uint32":     true,
-	"uint64":     true,
-	"uint8":      true,
-	"uintptr":    true,
-}
-
-func cleanPackageName(name string) GoPackageName {
-	name = strings.Map(badToUnderscore, name)
-	// Identifier must not be keyword or predeclared identifier: insert _.
-	if isGoKeyword[name] {
-		name = "_" + name
-	}
-	// Identifier must not begin with digit: insert _.
-	if r, _ := utf8.DecodeRuneInString(name); unicode.IsDigit(r) {
-		name = "_" + name
-	}
-	return GoPackageName(name)
-}
-
-// defaultGoPackage returns the package name to use,
-// derived from the import path of the package we're building code for.
-func (g *Generator) defaultGoPackage() GoPackageName {
-	p := g.PackageImportPath
-	if i := strings.LastIndex(p, "/"); i >= 0 {
-		p = p[i+1:]
-	}
-	return cleanPackageName(p)
-}
-
-// SetPackageNames sets the package name for this run.
-// The package name must agree across all files being generated.
-// It also defines unique package names for all imported files.
-func (g *Generator) SetPackageNames() {
-	g.outputImportPath = g.genFiles[0].importPath
-
-	defaultPackageNames := make(map[GoImportPath]GoPackageName)
-	for _, f := range g.genFiles {
-		if _, p, ok := f.goPackageOption(); ok {
-			defaultPackageNames[f.importPath] = p
-		}
-	}
-	for _, f := range g.genFiles {
-		if _, p, ok := f.goPackageOption(); ok {
-			// Source file: option go_package = "quux/bar";
-			f.packageName = p
-		} else if p, ok := defaultPackageNames[f.importPath]; ok {
-			// A go_package option in another file in the same package.
-			//
-			// This is a poor choice in general, since every source file should
-			// contain a go_package option. Supported mainly for historical
-			// compatibility.
-			f.packageName = p
-		} else if p := g.defaultGoPackage(); p != "" {
-			// Command-line: import_path=quux/bar.
-			//
-			// The import_path flag sets a package name for files which don't
-			// contain a go_package option.
-			f.packageName = p
-		} else if p := f.GetPackage(); p != "" {
-			// Source file: package quux.bar;
-			f.packageName = cleanPackageName(p)
-		} else {
-			// Source filename.
-			f.packageName = cleanPackageName(baseName(f.GetName()))
-		}
-	}
-
-	// Check that all files have a consistent package name and import path.
-	for _, f := range g.genFiles[1:] {
-		if a, b := g.genFiles[0].importPath, f.importPath; a != b {
-			g.Fail(fmt.Sprintf("inconsistent package import paths: %v, %v", a, b))
-		}
-		if a, b := g.genFiles[0].packageName, f.packageName; a != b {
-			g.Fail(fmt.Sprintf("inconsistent package names: %v, %v", a, b))
-		}
-	}
-
-	// Names of support packages. These never vary (if there are conflicts,
-	// we rename the conflicting package), so this could be removed someday.
-	g.Pkg = map[string]string{
-		"fmt":   "fmt",
-		"math":  "math",
-		"proto": "proto",
-	}
-}
-
-// WrapTypes walks the incoming data, wrapping DescriptorProtos, EnumDescriptorProtos
-// and FileDescriptorProtos into file-referenced objects within the Generator.
-// It also creates the list of files to generate and so should be called before GenerateAllFiles.
-func (g *Generator) WrapTypes() {
-	g.allFiles = make([]*FileDescriptor, 0, len(g.Request.ProtoFile))
-	g.allFilesByName = make(map[string]*FileDescriptor, len(g.allFiles))
-	genFileNames := make(map[string]bool)
-	for _, n := range g.Request.FileToGenerate {
-		genFileNames[n] = true
-	}
-	for _, f := range g.Request.ProtoFile {
-		fd := &FileDescriptor{
-			FileDescriptorProto: f,
-			exported:            make(map[Object][]symbol),
-			proto3:              fileIsProto3(f),
-		}
-		// The import path may be set in a number of ways.
-		if substitution, ok := g.ImportMap[f.GetName()]; ok {
-			// Command-line: M=foo.proto=quux/bar.
-			//
-			// Explicit mapping of source file to import path.
-			fd.importPath = GoImportPath(substitution)
-		} else if genFileNames[f.GetName()] && g.PackageImportPath != "" {
-			// Command-line: import_path=quux/bar.
-			//
-			// The import_path flag sets the import path for every file that
-			// we generate code for.
-			fd.importPath = GoImportPath(g.PackageImportPath)
-		} else if p, _, _ := fd.goPackageOption(); p != "" {
-			// Source file: option go_package = "quux/bar";
-			//
-			// The go_package option sets the import path. Most users should use this.
-			fd.importPath = p
-		} else {
-			// Source filename.
-			//
-			// Last resort when nothing else is available.
-			fd.importPath = GoImportPath(path.Dir(f.GetName()))
-		}
-		// We must wrap the descriptors before we wrap the enums
-		fd.desc = wrapDescriptors(fd)
-		g.buildNestedDescriptors(fd.desc)
-		fd.enum = wrapEnumDescriptors(fd, fd.desc)
-		g.buildNestedEnums(fd.desc, fd.enum)
-		fd.ext = wrapExtensions(fd)
-		extractComments(fd)
-		g.allFiles = append(g.allFiles, fd)
-		g.allFilesByName[f.GetName()] = fd
-	}
-	for _, fd := range g.allFiles {
-		fd.imp = wrapImported(fd, g)
-	}
-
-	g.genFiles = make([]*FileDescriptor, 0, len(g.Request.FileToGenerate))
-	for _, fileName := range g.Request.FileToGenerate {
-		fd := g.allFilesByName[fileName]
-		if fd == nil {
-			g.Fail("could not find file named", fileName)
-		}
-		g.genFiles = append(g.genFiles, fd)
-	}
-}
-
-// Scan the descriptors in this file.  For each one, build the slice of nested descriptors
-func (g *Generator) buildNestedDescriptors(descs []*Descriptor) {
-	for _, desc := range descs {
-		if len(desc.NestedType) != 0 {
-			for _, nest := range descs {
-				if nest.parent == desc {
-					desc.nested = append(desc.nested, nest)
-				}
-			}
-			if len(desc.nested) != len(desc.NestedType) {
-				g.Fail("internal error: nesting failure for", desc.GetName())
-			}
-		}
-	}
-}
-
-func (g *Generator) buildNestedEnums(descs []*Descriptor, enums []*EnumDescriptor) {
-	for _, desc := range descs {
-		if len(desc.EnumType) != 0 {
-			for _, enum := range enums {
-				if enum.parent == desc {
-					desc.enums = append(desc.enums, enum)
-				}
-			}
-			if len(desc.enums) != len(desc.EnumType) {
-				g.Fail("internal error: enum nesting failure for", desc.GetName())
-			}
-		}
-	}
-}
-
-// Construct the Descriptor
-func newDescriptor(desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *Descriptor {
-	d := &Descriptor{
-		common:          common{file},
-		DescriptorProto: desc,
-		parent:          parent,
-		index:           index,
-	}
-	if parent == nil {
-		d.path = fmt.Sprintf("%d,%d", messagePath, index)
-	} else {
-		d.path = fmt.Sprintf("%s,%d,%d", parent.path, messageMessagePath, index)
-	}
-
-	// The only way to distinguish a group from a message is whether
-	// the containing message has a TYPE_GROUP field that matches.
-	if parent != nil {
-		parts := d.TypeName()
-		if file.Package != nil {
-			parts = append([]string{*file.Package}, parts...)
-		}
-		exp := "." + strings.Join(parts, ".")
-		for _, field := range parent.Field {
-			if field.GetType() == descriptor.FieldDescriptorProto_TYPE_GROUP && field.GetTypeName() == exp {
-				d.group = true
-				break
-			}
-		}
-	}
-
-	for _, field := range desc.Extension {
-		d.ext = append(d.ext, &ExtensionDescriptor{common{file}, field, d})
-	}
-
-	return d
-}
-
-// Return a slice of all the Descriptors defined within this file
-func wrapDescriptors(file *FileDescriptor) []*Descriptor {
-	sl := make([]*Descriptor, 0, len(file.MessageType)+10)
-	for i, desc := range file.MessageType {
-		sl = wrapThisDescriptor(sl, desc, nil, file, i)
-	}
-	return sl
-}
-
-// Wrap this Descriptor, recursively
-func wrapThisDescriptor(sl []*Descriptor, desc *descriptor.DescriptorProto, parent *Descriptor, file *FileDescriptor, index int) []*Descriptor {
-	sl = append(sl, newDescriptor(desc, parent, file, index))
-	me := sl[len(sl)-1]
-	for i, nested := range desc.NestedType {
-		sl = wrapThisDescriptor(sl, nested, me, file, i)
-	}
-	return sl
-}
-
-// Construct the EnumDescriptor
-func newEnumDescriptor(desc *descriptor.EnumDescriptorProto, parent *Descriptor, file *FileDescriptor, index int) *EnumDescriptor {
-	ed := &EnumDescriptor{
-		common:              common{file},
-		EnumDescriptorProto: desc,
-		parent:              parent,
-		index:               index,
-	}
-	if parent == nil {
-		ed.path = fmt.Sprintf("%d,%d", enumPath, index)
-	} else {
-		ed.path = fmt.Sprintf("%s,%d,%d", parent.path, messageEnumPath, index)
-	}
-	return ed
-}
-
-// Return a slice of all the EnumDescriptors defined within this file
-func wrapEnumDescriptors(file *FileDescriptor, descs []*Descriptor) []*EnumDescriptor {
-	sl := make([]*EnumDescriptor, 0, len(file.EnumType)+10)
-	// Top-level enums.
-	for i, enum := range file.EnumType {
-		sl = append(sl, newEnumDescriptor(enum, nil, file, i))
-	}
-	// Enums within messages. Enums within embedded messages appear in the outer-most message.
-	for _, nested := range descs {
-		for i, enum := range nested.EnumType {
-			sl = append(sl, newEnumDescriptor(enum, nested, file, i))
-		}
-	}
-	return sl
-}
-
-// Return a slice of all the top-level ExtensionDescriptors defined within this file.
-func wrapExtensions(file *FileDescriptor) []*ExtensionDescriptor {
-	var sl []*ExtensionDescriptor
-	for _, field := range file.Extension {
-		sl = append(sl, &ExtensionDescriptor{common{file}, field, nil})
-	}
-	return sl
-}
-
-// Return a slice of all the types that are publicly imported into this file.
-func wrapImported(file *FileDescriptor, g *Generator) (sl []*ImportedDescriptor) {
-	for _, index := range file.PublicDependency {
-		df := g.fileByName(file.Dependency[index])
-		for _, d := range df.desc {
-			if d.GetOptions().GetMapEntry() {
-				continue
-			}
-			sl = append(sl, &ImportedDescriptor{common{file}, d})
-		}
-		for _, e := range df.enum {
-			sl = append(sl, &ImportedDescriptor{common{file}, e})
-		}
-		for _, ext := range df.ext {
-			sl = append(sl, &ImportedDescriptor{common{file}, ext})
-		}
-	}
-	return
-}
-
-func extractComments(file *FileDescriptor) {
-	file.comments = make(map[string]*descriptor.SourceCodeInfo_Location)
-	for _, loc := range file.GetSourceCodeInfo().GetLocation() {
-		if loc.LeadingComments == nil {
-			continue
-		}
-		var p []string
-		for _, n := range loc.Path {
-			p = append(p, strconv.Itoa(int(n)))
-		}
-		file.comments[strings.Join(p, ",")] = loc
-	}
-}
-
-// BuildTypeNameMap builds the map from fully qualified type names to objects.
-// The key names for the map come from the input data, which puts a period at the beginning.
-// It should be called after SetPackageNames and before GenerateAllFiles.
-func (g *Generator) BuildTypeNameMap() {
-	g.typeNameToObject = make(map[string]Object)
-	for _, f := range g.allFiles {
-		// The names in this loop are defined by the proto world, not us, so the
-		// package name may be empty.  If so, the dotted package name of X will
-		// be ".X"; otherwise it will be ".pkg.X".
-		dottedPkg := "." + f.GetPackage()
-		if dottedPkg != "." {
-			dottedPkg += "."
-		}
-		for _, enum := range f.enum {
-			name := dottedPkg + dottedSlice(enum.TypeName())
-			g.typeNameToObject[name] = enum
-		}
-		for _, desc := range f.desc {
-			name := dottedPkg + dottedSlice(desc.TypeName())
-			g.typeNameToObject[name] = desc
-		}
-	}
-}
-
-// ObjectNamed, given a fully-qualified input type name as it appears in the input data,
-// returns the descriptor for the message or enum with that name.
-func (g *Generator) ObjectNamed(typeName string) Object {
-	o, ok := g.typeNameToObject[typeName]
-	if !ok {
-		g.Fail("can't find object with type", typeName)
-	}
-	return o
-}
-
-// AnnotatedAtoms is a list of atoms (as consumed by P) that records the file name and proto AST path from which they originated.
-type AnnotatedAtoms struct {
-	source string
-	path   string
-	atoms  []interface{}
-}
-
-// Annotate records the file name and proto AST path of a list of atoms
-// so that a later call to P can emit a link from each atom to its origin.
-func Annotate(file *FileDescriptor, path string, atoms ...interface{}) *AnnotatedAtoms {
-	return &AnnotatedAtoms{source: *file.Name, path: path, atoms: atoms}
-}
-
-// printAtom prints the (atomic, non-annotation) argument to the generated output.
-func (g *Generator) printAtom(v interface{}) {
-	switch v := v.(type) {
-	case string:
-		g.WriteString(v)
-	case *string:
-		g.WriteString(*v)
-	case bool:
-		fmt.Fprint(g, v)
-	case *bool:
-		fmt.Fprint(g, *v)
-	case int:
-		fmt.Fprint(g, v)
-	case *int32:
-		fmt.Fprint(g, *v)
-	case *int64:
-		fmt.Fprint(g, *v)
-	case float64:
-		fmt.Fprint(g, v)
-	case *float64:
-		fmt.Fprint(g, *v)
-	case GoPackageName:
-		g.WriteString(string(v))
-	case GoImportPath:
-		g.WriteString(strconv.Quote(string(v)))
-	default:
-		g.Fail(fmt.Sprintf("unknown type in printer: %T", v))
-	}
-}
-
-// P prints the arguments to the generated output.  It handles strings and int32s, plus
-// handling indirections because they may be *string, etc.  Any inputs of type AnnotatedAtoms may emit
-// annotations in a .meta file in addition to outputting the atoms themselves (if g.annotateCode
-// is true).
-func (g *Generator) P(str ...interface{}) {
-	if !g.writeOutput {
-		return
-	}
-	g.WriteString(g.indent)
-	for _, v := range str {
-		switch v := v.(type) {
-		case *AnnotatedAtoms:
-			begin := int32(g.Len())
-			for _, v := range v.atoms {
-				g.printAtom(v)
-			}
-			if g.annotateCode {
-				end := int32(g.Len())
-				var path []int32
-				for _, token := range strings.Split(v.path, ",") {
-					val, err := strconv.ParseInt(token, 10, 32)
-					if err != nil {
-						g.Fail("could not parse proto AST path: ", err.Error())
-					}
-					path = append(path, int32(val))
-				}
-				g.annotations = append(g.annotations, &descriptor.GeneratedCodeInfo_Annotation{
-					Path:       path,
-					SourceFile: &v.source,
-					Begin:      &begin,
-					End:        &end,
-				})
-			}
-		default:
-			g.printAtom(v)
-		}
-	}
-	g.WriteByte('\n')
-}
-
-// addInitf stores the given statement to be printed inside the file's init function.
-// The statement is given as a format specifier and arguments.
-func (g *Generator) addInitf(stmt string, a ...interface{}) {
-	g.init = append(g.init, fmt.Sprintf(stmt, a...))
-}
-
-// In Indents the output one tab stop.
-func (g *Generator) In() { g.indent += "\t" }
-
-// Out unindents the output one tab stop.
-func (g *Generator) Out() {
-	if len(g.indent) > 0 {
-		g.indent = g.indent[1:]
-	}
-}
-
-// GenerateAllFiles generates the output for all the files we're outputting.
-func (g *Generator) GenerateAllFiles() {
-	// Initialize the plugins
-	for _, p := range plugins {
-		p.Init(g)
-	}
-	// Generate the output. The generator runs for every file, even the files
-	// that we don't generate output for, so that we can collate the full list
-	// of exported symbols to support public imports.
-	genFileMap := make(map[*FileDescriptor]bool, len(g.genFiles))
-	for _, file := range g.genFiles {
-		genFileMap[file] = true
-	}
-	for _, file := range g.allFiles {
-		g.Reset()
-		g.annotations = nil
-		g.writeOutput = genFileMap[file]
-		g.generate(file)
-		if !g.writeOutput {
-			continue
-		}
-		fname := file.goFileName(g.pathType)
-		g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
-			Name:    proto.String(fname),
-			Content: proto.String(g.String()),
-		})
-		if g.annotateCode {
-			// Store the generated code annotations in text, as the protoc plugin protocol requires that
-			// strings contain valid UTF-8.
-			g.Response.File = append(g.Response.File, &plugin.CodeGeneratorResponse_File{
-				Name:    proto.String(file.goFileName(g.pathType) + ".meta"),
-				Content: proto.String(proto.CompactTextString(&descriptor.GeneratedCodeInfo{Annotation: g.annotations})),
-			})
-		}
-	}
-}
-
-// Run all the plugins associated with the file.
-func (g *Generator) runPlugins(file *FileDescriptor) {
-	for _, p := range plugins {
-		p.Generate(file)
-	}
-}
-
-// Fill the response protocol buffer with the generated output for all the files we're
-// supposed to generate.
-func (g *Generator) generate(file *FileDescriptor) {
-	g.file = file
-	g.usedPackages = make(map[GoImportPath]bool)
-	g.packageNames = make(map[GoImportPath]GoPackageName)
-	g.usedPackageNames = make(map[GoPackageName]bool)
-	g.addedImports = make(map[GoImportPath]bool)
-	for name := range globalPackageNames {
-		g.usedPackageNames[name] = true
-	}
-
-	g.P("// This is a compile-time assertion to ensure that this generated file")
-	g.P("// is compatible with the proto package it is being compiled against.")
-	g.P("// A compilation error at this line likely means your copy of the")
-	g.P("// proto package needs to be updated.")
-	g.P("const _ = ", g.Pkg["proto"], ".ProtoPackageIsVersion", generatedCodeVersion, " // please upgrade the proto package")
-	g.P()
-
-	for _, td := range g.file.imp {
-		g.generateImported(td)
-	}
-	for _, enum := range g.file.enum {
-		g.generateEnum(enum)
-	}
-	for _, desc := range g.file.desc {
-		// Don't generate virtual messages for maps.
-		if desc.GetOptions().GetMapEntry() {
-			continue
-		}
-		g.generateMessage(desc)
-	}
-	for _, ext := range g.file.ext {
-		g.generateExtension(ext)
-	}
-	g.generateInitFunction()
-	g.generateFileDescriptor(file)
-
-	// Run the plugins before the imports so we know which imports are necessary.
-	g.runPlugins(file)
-
-	// Generate header and imports last, though they appear first in the output.
-	rem := g.Buffer
-	remAnno := g.annotations
-	g.Buffer = new(bytes.Buffer)
-	g.annotations = nil
-	g.generateHeader()
-	g.generateImports()
-	if !g.writeOutput {
-		return
-	}
-	// Adjust the offsets for annotations displaced by the header and imports.
-	for _, anno := range remAnno {
-		*anno.Begin += int32(g.Len())
-		*anno.End += int32(g.Len())
-		g.annotations = append(g.annotations, anno)
-	}
-	g.Write(rem.Bytes())
-
-	// Reformat generated code and patch annotation locations.
-	fset := token.NewFileSet()
-	original := g.Bytes()
-	if g.annotateCode {
-		// make a copy independent of g; we'll need it after Reset.
-		original = append([]byte(nil), original...)
-	}
-	fileAST, err := parser.ParseFile(fset, "", original, parser.ParseComments)
-	if err != nil {
-		// Print out the bad code with line numbers.
-		// This should never happen in practice, but it can while changing generated code,
-		// so consider this a debugging aid.
-		var src bytes.Buffer
-		s := bufio.NewScanner(bytes.NewReader(original))
-		for line := 1; s.Scan(); line++ {
-			fmt.Fprintf(&src, "%5d\t%s\n", line, s.Bytes())
-		}
-		g.Fail("bad Go source code was generated:", err.Error(), "\n"+src.String())
-	}
-	ast.SortImports(fset, fileAST)
-	g.Reset()
-	err = (&printer.Config{Mode: printer.TabIndent | printer.UseSpaces, Tabwidth: 8}).Fprint(g, fset, fileAST)
-	if err != nil {
-		g.Fail("generated Go source code could not be reformatted:", err.Error())
-	}
-	if g.annotateCode {
-		m, err := remap.Compute(original, g.Bytes())
-		if err != nil {
-			g.Fail("formatted generated Go source code could not be mapped back to the original code:", err.Error())
-		}
-		for _, anno := range g.annotations {
-			new, ok := m.Find(int(*anno.Begin), int(*anno.End))
-			if !ok {
-				g.Fail("span in formatted generated Go source code could not be mapped back to the original code")
-			}
-			*anno.Begin = int32(new.Pos)
-			*anno.End = int32(new.End)
-		}
-	}
-}
-
-// Generate the header, including package definition
-func (g *Generator) generateHeader() {
-	g.P("// Code generated by protoc-gen-go. DO NOT EDIT.")
-	if g.file.GetOptions().GetDeprecated() {
-		g.P("// ", g.file.Name, " is a deprecated file.")
-	} else {
-		g.P("// source: ", g.file.Name)
-	}
-	g.P()
-	g.PrintComments(strconv.Itoa(packagePath))
-	g.P()
-	g.P("package ", g.file.packageName)
-	g.P()
-}
-
-// deprecationComment is the standard comment added to deprecated
-// messages, fields, enums, and enum values.
-var deprecationComment = "// Deprecated: Do not use."
-
-// PrintComments prints any comments from the source .proto file.
-// The path is a comma-separated list of integers.
-// It returns an indication of whether any comments were printed.
-// See descriptor.proto for its format.
-func (g *Generator) PrintComments(path string) bool {
-	if !g.writeOutput {
-		return false
-	}
-	if c, ok := g.makeComments(path); ok {
-		g.P(c)
-		return true
-	}
-	return false
-}
-
-// makeComments generates the comment string for the field, no "\n" at the end
-func (g *Generator) makeComments(path string) (string, bool) {
-	loc, ok := g.file.comments[path]
-	if !ok {
-		return "", false
-	}
-	w := new(bytes.Buffer)
-	nl := ""
-	for _, line := range strings.Split(strings.TrimSuffix(loc.GetLeadingComments(), "\n"), "\n") {
-		fmt.Fprintf(w, "%s//%s", nl, line)
-		nl = "\n"
-	}
-	return w.String(), true
-}
-
-func (g *Generator) fileByName(filename string) *FileDescriptor {
-	return g.allFilesByName[filename]
-}
-
-// weak returns whether the ith import of the current file is a weak import.
-func (g *Generator) weak(i int32) bool {
-	for _, j := range g.file.WeakDependency {
-		if j == i {
-			return true
-		}
-	}
-	return false
-}
-
-// Generate the imports
-func (g *Generator) generateImports() {
-	imports := make(map[GoImportPath]GoPackageName)
-	for i, s := range g.file.Dependency {
-		fd := g.fileByName(s)
-		importPath := fd.importPath
-		// Do not import our own package.
-		if importPath == g.file.importPath {
-			continue
-		}
-		// Do not import weak imports.
-		if g.weak(int32(i)) {
-			continue
-		}
-		// Do not import a package twice.
-		if _, ok := imports[importPath]; ok {
-			continue
-		}
-		// We need to import all the dependencies, even if we don't reference them,
-		// because other code and tools depend on having the full transitive closure
-		// of protocol buffer types in the binary.
-		packageName := g.GoPackageName(importPath)
-		if _, ok := g.usedPackages[importPath]; !ok {
-			packageName = "_"
-		}
-		imports[importPath] = packageName
-	}
-	for importPath := range g.addedImports {
-		imports[importPath] = g.GoPackageName(importPath)
-	}
-	// We almost always need a proto import.  Rather than computing when we
-	// do, which is tricky when there's a plugin, just import it and
-	// reference it later. The same argument applies to the fmt and math packages.
-	g.P("import (")
-	g.P(g.Pkg["fmt"] + ` "fmt"`)
-	g.P(g.Pkg["math"] + ` "math"`)
-	g.P(g.Pkg["proto"]+" ", GoImportPath(g.ImportPrefix)+"github.com/golang/protobuf/proto")
-	for importPath, packageName := range imports {
-		g.P(packageName, " ", GoImportPath(g.ImportPrefix)+importPath)
-	}
-	g.P(")")
-	g.P()
-	// TODO: may need to worry about uniqueness across plugins
-	for _, p := range plugins {
-		p.GenerateImports(g.file)
-		g.P()
-	}
-	g.P("// Reference imports to suppress errors if they are not otherwise used.")
-	g.P("var _ = ", g.Pkg["proto"], ".Marshal")
-	g.P("var _ = ", g.Pkg["fmt"], ".Errorf")
-	g.P("var _ = ", g.Pkg["math"], ".Inf")
-	g.P()
-}
-
-func (g *Generator) generateImported(id *ImportedDescriptor) {
-	df := id.o.File()
-	filename := *df.Name
-	if df.importPath == g.file.importPath {
-		// Don't generate type aliases for files in the same Go package as this one.
-		return
-	}
-	if !supportTypeAliases {
-		g.Fail(fmt.Sprintf("%s: public imports require at least go1.9", filename))
-	}
-	g.usedPackages[df.importPath] = true
-
-	for _, sym := range df.exported[id.o] {
-		sym.GenerateAlias(g, filename, g.GoPackageName(df.importPath))
-	}
-
-	g.P()
-}
-
-// Generate the enum definitions for this EnumDescriptor.
-func (g *Generator) generateEnum(enum *EnumDescriptor) {
-	// The full type name
-	typeName := enum.TypeName()
-	// The full type name, CamelCased.
-	ccTypeName := CamelCaseSlice(typeName)
-	ccPrefix := enum.prefix()
-
-	deprecatedEnum := ""
-	if enum.GetOptions().GetDeprecated() {
-		deprecatedEnum = deprecationComment
-	}
-	g.PrintComments(enum.path)
-	g.P("type ", Annotate(enum.file, enum.path, ccTypeName), " int32", deprecatedEnum)
-	g.file.addExport(enum, enumSymbol{ccTypeName, enum.proto3()})
-	g.P("const (")
-	for i, e := range enum.Value {
-		etorPath := fmt.Sprintf("%s,%d,%d", enum.path, enumValuePath, i)
-		g.PrintComments(etorPath)
-
-		deprecatedValue := ""
-		if e.GetOptions().GetDeprecated() {
-			deprecatedValue = deprecationComment
-		}
-
-		name := ccPrefix + *e.Name
-		g.P(Annotate(enum.file, etorPath, name), " ", ccTypeName, " = ", e.Number, " ", deprecatedValue)
-		g.file.addExport(enum, constOrVarSymbol{name, "const", ccTypeName})
-	}
-	g.P(")")
-	g.P()
-	g.P("var ", ccTypeName, "_name = map[int32]string{")
-	generated := make(map[int32]bool) // avoid duplicate values
-	for _, e := range enum.Value {
-		duplicate := ""
-		if _, present := generated[*e.Number]; present {
-			duplicate = "// Duplicate value: "
-		}
-		g.P(duplicate, e.Number, ": ", strconv.Quote(*e.Name), ",")
-		generated[*e.Number] = true
-	}
-	g.P("}")
-	g.P()
-	g.P("var ", ccTypeName, "_value = map[string]int32{")
-	for _, e := range enum.Value {
-		g.P(strconv.Quote(*e.Name), ": ", e.Number, ",")
-	}
-	g.P("}")
-	g.P()
-
-	if !enum.proto3() {
-		g.P("func (x ", ccTypeName, ") Enum() *", ccTypeName, " {")
-		g.P("p := new(", ccTypeName, ")")
-		g.P("*p = x")
-		g.P("return p")
-		g.P("}")
-		g.P()
-	}
-
-	g.P("func (x ", ccTypeName, ") String() string {")
-	g.P("return ", g.Pkg["proto"], ".EnumName(", ccTypeName, "_name, int32(x))")
-	g.P("}")
-	g.P()
-
-	if !enum.proto3() {
-		g.P("func (x *", ccTypeName, ") UnmarshalJSON(data []byte) error {")
-		g.P("value, err := ", g.Pkg["proto"], ".UnmarshalJSONEnum(", ccTypeName, `_value, data, "`, ccTypeName, `")`)
-		g.P("if err != nil {")
-		g.P("return err")
-		g.P("}")
-		g.P("*x = ", ccTypeName, "(value)")
-		g.P("return nil")
-		g.P("}")
-		g.P()
-	}
-
-	var indexes []string
-	for m := enum.parent; m != nil; m = m.parent {
-		// XXX: skip groups?
-		indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
-	}
-	indexes = append(indexes, strconv.Itoa(enum.index))
-	g.P("func (", ccTypeName, ") EnumDescriptor() ([]byte, []int) {")
-	g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
-	g.P("}")
-	g.P()
-	if enum.file.GetPackage() == "google.protobuf" && enum.GetName() == "NullValue" {
-		g.P("func (", ccTypeName, `) XXX_WellKnownType() string { return "`, enum.GetName(), `" }`)
-		g.P()
-	}
-
-	g.generateEnumRegistration(enum)
-}
-
-// The tag is a string like "varint,2,opt,name=fieldname,def=7" that
-// identifies details of the field for the protocol buffer marshaling and unmarshaling
-// code.  The fields are:
-//	wire encoding
-//	protocol tag number
-//	opt,req,rep for optional, required, or repeated
-//	packed whether the encoding is "packed" (optional; repeated primitives only)
-//	name= the original declared name
-//	enum= the name of the enum type if it is an enum-typed field.
-//	proto3 if this field is in a proto3 message
-//	def= string representation of the default value, if any.
-// The default value must be in a representation that can be used at run-time
-// to generate the default value. Thus bools become 0 and 1, for instance.
-func (g *Generator) goTag(message *Descriptor, field *descriptor.FieldDescriptorProto, wiretype string) string {
-	optrepreq := ""
-	switch {
-	case isOptional(field):
-		optrepreq = "opt"
-	case isRequired(field):
-		optrepreq = "req"
-	case isRepeated(field):
-		optrepreq = "rep"
-	}
-	var defaultValue string
-	if dv := field.DefaultValue; dv != nil { // set means an explicit default
-		defaultValue = *dv
-		// Some types need tweaking.
-		switch *field.Type {
-		case descriptor.FieldDescriptorProto_TYPE_BOOL:
-			if defaultValue == "true" {
-				defaultValue = "1"
-			} else {
-				defaultValue = "0"
-			}
-		case descriptor.FieldDescriptorProto_TYPE_STRING,
-			descriptor.FieldDescriptorProto_TYPE_BYTES:
-			// Nothing to do. Quoting is done for the whole tag.
-		case descriptor.FieldDescriptorProto_TYPE_ENUM:
-			// For enums we need to provide the integer constant.
-			obj := g.ObjectNamed(field.GetTypeName())
-			if id, ok := obj.(*ImportedDescriptor); ok {
-				// It is an enum that was publicly imported.
-				// We need the underlying type.
-				obj = id.o
-			}
-			enum, ok := obj.(*EnumDescriptor)
-			if !ok {
-				log.Printf("obj is a %T", obj)
-				if id, ok := obj.(*ImportedDescriptor); ok {
-					log.Printf("id.o is a %T", id.o)
-				}
-				g.Fail("unknown enum type", CamelCaseSlice(obj.TypeName()))
-			}
-			defaultValue = enum.integerValueAsString(defaultValue)
-		case descriptor.FieldDescriptorProto_TYPE_FLOAT:
-			if def := defaultValue; def != "inf" && def != "-inf" && def != "nan" {
-				if f, err := strconv.ParseFloat(defaultValue, 32); err == nil {
-					defaultValue = fmt.Sprint(float32(f))
-				}
-			}
-		case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
-			if def := defaultValue; def != "inf" && def != "-inf" && def != "nan" {
-				if f, err := strconv.ParseFloat(defaultValue, 64); err == nil {
-					defaultValue = fmt.Sprint(f)
-				}
-			}
-		}
-		defaultValue = ",def=" + defaultValue
-	}
-	enum := ""
-	if *field.Type == descriptor.FieldDescriptorProto_TYPE_ENUM {
-		// We avoid using obj.GoPackageName(), because we want to use the
-		// original (proto-world) package name.
-		obj := g.ObjectNamed(field.GetTypeName())
-		if id, ok := obj.(*ImportedDescriptor); ok {
-			obj = id.o
-		}
-		enum = ",enum="
-		if pkg := obj.File().GetPackage(); pkg != "" {
-			enum += pkg + "."
-		}
-		enum += CamelCaseSlice(obj.TypeName())
-	}
-	packed := ""
-	if (field.Options != nil && field.Options.GetPacked()) ||
-		// Per https://developers.google.com/protocol-buffers/docs/proto3#simple:
-		// "In proto3, repeated fields of scalar numeric types use packed encoding by default."
-		(message.proto3() && (field.Options == nil || field.Options.Packed == nil) &&
-			isRepeated(field) && isScalar(field)) {
-		packed = ",packed"
-	}
-	fieldName := field.GetName()
-	name := fieldName
-	if *field.Type == descriptor.FieldDescriptorProto_TYPE_GROUP {
-		// We must use the type name for groups instead of
-		// the field name to preserve capitalization.
-		// type_name in FieldDescriptorProto is fully-qualified,
-		// but we only want the local part.
-		name = *field.TypeName
-		if i := strings.LastIndex(name, "."); i >= 0 {
-			name = name[i+1:]
-		}
-	}
-	if json := field.GetJsonName(); field.Extendee == nil && json != "" && json != name {
-		// TODO: escaping might be needed, in which case
-		// perhaps this should be in its own "json" tag.
-		name += ",json=" + json
-	}
-	name = ",name=" + name
-	if message.proto3() {
-		name += ",proto3"
-	}
-	oneof := ""
-	if field.OneofIndex != nil {
-		oneof = ",oneof"
-	}
-	return strconv.Quote(fmt.Sprintf("%s,%d,%s%s%s%s%s%s",
-		wiretype,
-		field.GetNumber(),
-		optrepreq,
-		packed,
-		name,
-		enum,
-		oneof,
-		defaultValue))
-}
-
-func needsStar(typ descriptor.FieldDescriptorProto_Type) bool {
-	switch typ {
-	case descriptor.FieldDescriptorProto_TYPE_GROUP:
-		return false
-	case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
-		return false
-	case descriptor.FieldDescriptorProto_TYPE_BYTES:
-		return false
-	}
-	return true
-}
-
-// TypeName is the printed name appropriate for an item. If the object is in the current file,
-// TypeName drops the package name and underscores the rest.
-// Otherwise the object is from another package; and the result is the underscored
-// package name followed by the item name.
-// The result always has an initial capital.
-func (g *Generator) TypeName(obj Object) string {
-	return g.DefaultPackageName(obj) + CamelCaseSlice(obj.TypeName())
-}
-
-// GoType returns a string representing the type name, and the wire type
-func (g *Generator) GoType(message *Descriptor, field *descriptor.FieldDescriptorProto) (typ string, wire string) {
-	// TODO: Options.
-	switch *field.Type {
-	case descriptor.FieldDescriptorProto_TYPE_DOUBLE:
-		typ, wire = "float64", "fixed64"
-	case descriptor.FieldDescriptorProto_TYPE_FLOAT:
-		typ, wire = "float32", "fixed32"
-	case descriptor.FieldDescriptorProto_TYPE_INT64:
-		typ, wire = "int64", "varint"
-	case descriptor.FieldDescriptorProto_TYPE_UINT64:
-		typ, wire = "uint64", "varint"
-	case descriptor.FieldDescriptorProto_TYPE_INT32:
-		typ, wire = "int32", "varint"
-	case descriptor.FieldDescriptorProto_TYPE_UINT32:
-		typ, wire = "uint32", "varint"
-	case descriptor.FieldDescriptorProto_TYPE_FIXED64:
-		typ, wire = "uint64", "fixed64"
-	case descriptor.FieldDescriptorProto_TYPE_FIXED32:
-		typ, wire = "uint32", "fixed32"
-	case descriptor.FieldDescriptorProto_TYPE_BOOL:
-		typ, wire = "bool", "varint"
-	case descriptor.FieldDescriptorProto_TYPE_STRING:
-		typ, wire = "string", "bytes"
-	case descriptor.FieldDescriptorProto_TYPE_GROUP:
-		desc := g.ObjectNamed(field.GetTypeName())
-		typ, wire = "*"+g.TypeName(desc), "group"
-	case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
-		desc := g.ObjectNamed(field.GetTypeName())
-		typ, wire = "*"+g.TypeName(desc), "bytes"
-	case descriptor.FieldDescriptorProto_TYPE_BYTES:
-		typ, wire = "[]byte", "bytes"
-	case descriptor.FieldDescriptorProto_TYPE_ENUM:
-		desc := g.ObjectNamed(field.GetTypeName())
-		typ, wire = g.TypeName(desc), "varint"
-	case descriptor.FieldDescriptorProto_TYPE_SFIXED32:
-		typ, wire = "int32", "fixed32"
-	case descriptor.FieldDescriptorProto_TYPE_SFIXED64:
-		typ, wire = "int64", "fixed64"
-	case descriptor.FieldDescriptorProto_TYPE_SINT32:
-		typ, wire = "int32", "zigzag32"
-	case descriptor.FieldDescriptorProto_TYPE_SINT64:
-		typ, wire = "int64", "zigzag64"
-	default:
-		g.Fail("unknown type for", field.GetName())
-	}
-	if isRepeated(field) {
-		typ = "[]" + typ
-	} else if message != nil && message.proto3() {
-		return
-	} else if field.OneofIndex != nil && message != nil {
-		return
-	} else if needsStar(*field.Type) {
-		typ = "*" + typ
-	}
-	return
-}
-
-func (g *Generator) RecordTypeUse(t string) {
-	if _, ok := g.typeNameToObject[t]; !ok {
-		return
-	}
-	importPath := g.ObjectNamed(t).GoImportPath()
-	if importPath == g.outputImportPath {
-		// Don't record use of objects in our package.
-		return
-	}
-	g.AddImport(importPath)
-	g.usedPackages[importPath] = true
-}
-
-// Method names that may be generated.  Fields with these names get an
-// underscore appended. Any change to this set is a potential incompatible
-// API change because it changes generated field names.
-var methodNames = [...]string{
-	"Reset",
-	"String",
-	"ProtoMessage",
-	"Marshal",
-	"Unmarshal",
-	"ExtensionRangeArray",
-	"ExtensionMap",
-	"Descriptor",
-}
-
-// Names of messages in the `google.protobuf` package for which
-// we will generate XXX_WellKnownType methods.
-var wellKnownTypes = map[string]bool{
-	"Any":       true,
-	"Duration":  true,
-	"Empty":     true,
-	"Struct":    true,
-	"Timestamp": true,
-
-	"Value":       true,
-	"ListValue":   true,
-	"DoubleValue": true,
-	"FloatValue":  true,
-	"Int64Value":  true,
-	"UInt64Value": true,
-	"Int32Value":  true,
-	"UInt32Value": true,
-	"BoolValue":   true,
-	"StringValue": true,
-	"BytesValue":  true,
-}
-
-// getterDefault finds the default value for the field to return from a getter,
-// regardless of if it's a built in default or explicit from the source. Returns e.g. "nil", `""`, "Default_MessageType_FieldName"
-func (g *Generator) getterDefault(field *descriptor.FieldDescriptorProto, goMessageType string) string {
-	if isRepeated(field) {
-		return "nil"
-	}
-	if def := field.GetDefaultValue(); def != "" {
-		defaultConstant := g.defaultConstantName(goMessageType, field.GetName())
-		if *field.Type != descriptor.FieldDescriptorProto_TYPE_BYTES {
-			return defaultConstant
-		}
-		return "append([]byte(nil), " + defaultConstant + "...)"
-	}
-	switch *field.Type {
-	case descriptor.FieldDescriptorProto_TYPE_BOOL:
-		return "false"
-	case descriptor.FieldDescriptorProto_TYPE_STRING:
-		return `""`
-	case descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE, descriptor.FieldDescriptorProto_TYPE_BYTES:
-		return "nil"
-	case descriptor.FieldDescriptorProto_TYPE_ENUM:
-		obj := g.ObjectNamed(field.GetTypeName())
-		var enum *EnumDescriptor
-		if id, ok := obj.(*ImportedDescriptor); ok {
-			// The enum type has been publicly imported.
-			enum, _ = id.o.(*EnumDescriptor)
-		} else {
-			enum, _ = obj.(*EnumDescriptor)
-		}
-		if enum == nil {
-			log.Printf("don't know how to generate getter for %s", field.GetName())
-			return "nil"
-		}
-		if len(enum.Value) == 0 {
-			return "0 // empty enum"
-		}
-		first := enum.Value[0].GetName()
-		return g.DefaultPackageName(obj) + enum.prefix() + first
-	default:
-		return "0"
-	}
-}
-
-// defaultConstantName builds the name of the default constant from the message
-// type name and the untouched field name, e.g. "Default_MessageType_FieldName"
-func (g *Generator) defaultConstantName(goMessageType, protoFieldName string) string {
-	return "Default_" + goMessageType + "_" + CamelCase(protoFieldName)
-}
-
-// The different types of fields in a message and how to actually print them
-// Most of the logic for generateMessage is in the methods of these types.
-//
-// Note that the content of the field is irrelevant, a simpleField can contain
-// anything from a scalar to a group (which is just a message).
-//
-// Extension fields (and message sets) are however handled separately.
-//
-// simpleField - a field that is neiter weak nor oneof, possibly repeated
-// oneofField - field containing list of subfields:
-// - oneofSubField - a field within the oneof
-
-// msgCtx contains the context for the generator functions.
-type msgCtx struct {
-	goName  string      // Go struct name of the message, e.g. MessageName
-	message *Descriptor // The descriptor for the message
-}
-
-// fieldCommon contains data common to all types of fields.
-type fieldCommon struct {
-	goName     string // Go name of field, e.g. "FieldName" or "Descriptor_"
-	protoName  string // Name of field in proto language, e.g. "field_name" or "descriptor"
-	getterName string // Name of the getter, e.g. "GetFieldName" or "GetDescriptor_"
-	goType     string // The Go type as a string, e.g. "*int32" or "*OtherMessage"
-	tags       string // The tag string/annotation for the type, e.g. `protobuf:"varint,8,opt,name=region_id,json=regionId"`
-	fullPath   string // The full path of the field as used by Annotate etc, e.g. "4,0,2,0"
-}
-
-// getProtoName gets the proto name of a field, e.g. "field_name" or "descriptor".
-func (f *fieldCommon) getProtoName() string {
-	return f.protoName
-}
-
-// getGoType returns the go type of the field  as a string, e.g. "*int32".
-func (f *fieldCommon) getGoType() string {
-	return f.goType
-}
-
-// simpleField is not weak, not a oneof, not an extension. Can be required, optional or repeated.
-type simpleField struct {
-	fieldCommon
-	protoTypeName string                               // Proto type name, empty if primitive, e.g. ".google.protobuf.Duration"
-	protoType     descriptor.FieldDescriptorProto_Type // Actual type enum value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
-	deprecated    string                               // Deprecation comment, if any, e.g. "// Deprecated: Do not use."
-	getterDef     string                               // Default for getters, e.g. "nil", `""` or "Default_MessageType_FieldName"
-	protoDef      string                               // Default value as defined in the proto file, e.g "yoshi" or "5"
-	comment       string                               // The full comment for the field, e.g. "// Useful information"
-}
-
-// decl prints the declaration of the field in the struct (if any).
-func (f *simpleField) decl(g *Generator, mc *msgCtx) {
-	g.P(f.comment, Annotate(mc.message.file, f.fullPath, f.goName), "\t", f.goType, "\t`", f.tags, "`", f.deprecated)
-}
-
-// getter prints the getter for the field.
-func (f *simpleField) getter(g *Generator, mc *msgCtx) {
-	star := ""
-	tname := f.goType
-	if needsStar(f.protoType) && tname[0] == '*' {
-		tname = tname[1:]
-		star = "*"
-	}
-	if f.deprecated != "" {
-		g.P(f.deprecated)
-	}
-	g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, f.fullPath, f.getterName), "() "+tname+" {")
-	if f.getterDef == "nil" { // Simpler getter
-		g.P("if m != nil {")
-		g.P("return m." + f.goName)
-		g.P("}")
-		g.P("return nil")
-		g.P("}")
-		g.P()
-		return
-	}
-	if mc.message.proto3() {
-		g.P("if m != nil {")
-	} else {
-		g.P("if m != nil && m." + f.goName + " != nil {")
-	}
-	g.P("return " + star + "m." + f.goName)
-	g.P("}")
-	g.P("return ", f.getterDef)
-	g.P("}")
-	g.P()
-}
-
-// setter prints the setter method of the field.
-func (f *simpleField) setter(g *Generator, mc *msgCtx) {
-	// No setter for regular fields yet
-}
-
-// getProtoDef returns the default value explicitly stated in the proto file, e.g "yoshi" or "5".
-func (f *simpleField) getProtoDef() string {
-	return f.protoDef
-}
-
-// getProtoTypeName returns the protobuf type name for the field as returned by field.GetTypeName(), e.g. ".google.protobuf.Duration".
-func (f *simpleField) getProtoTypeName() string {
-	return f.protoTypeName
-}
-
-// getProtoType returns the *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64.
-func (f *simpleField) getProtoType() descriptor.FieldDescriptorProto_Type {
-	return f.protoType
-}
-
-// oneofSubFields are kept slize held by each oneofField. They do not appear in the top level slize of fields for the message.
-type oneofSubField struct {
-	fieldCommon
-	protoTypeName string                               // Proto type name, empty if primitive, e.g. ".google.protobuf.Duration"
-	protoType     descriptor.FieldDescriptorProto_Type // Actual type enum value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
-	oneofTypeName string                               // Type name of the enclosing struct, e.g. "MessageName_FieldName"
-	fieldNumber   int                                  // Actual field number, as defined in proto, e.g. 12
-	getterDef     string                               // Default for getters, e.g. "nil", `""` or "Default_MessageType_FieldName"
-	protoDef      string                               // Default value as defined in the proto file, e.g "yoshi" or "5"
-	deprecated    string                               // Deprecation comment, if any.
-}
-
-// typedNil prints a nil casted to the pointer to this field.
-// - for XXX_OneofWrappers
-func (f *oneofSubField) typedNil(g *Generator) {
-	g.P("(*", f.oneofTypeName, ")(nil),")
-}
-
-// getProtoDef returns the default value explicitly stated in the proto file, e.g "yoshi" or "5".
-func (f *oneofSubField) getProtoDef() string {
-	return f.protoDef
-}
-
-// getProtoTypeName returns the protobuf type name for the field as returned by field.GetTypeName(), e.g. ".google.protobuf.Duration".
-func (f *oneofSubField) getProtoTypeName() string {
-	return f.protoTypeName
-}
-
-// getProtoType returns the *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64.
-func (f *oneofSubField) getProtoType() descriptor.FieldDescriptorProto_Type {
-	return f.protoType
-}
-
-// oneofField represents the oneof on top level.
-// The alternative fields within the oneof are represented by oneofSubField.
-type oneofField struct {
-	fieldCommon
-	subFields []*oneofSubField // All the possible oneof fields
-	comment   string           // The full comment for the field, e.g. "// Types that are valid to be assigned to MyOneof:\n\\"
-}
-
-// decl prints the declaration of the field in the struct (if any).
-func (f *oneofField) decl(g *Generator, mc *msgCtx) {
-	comment := f.comment
-	for _, sf := range f.subFields {
-		comment += "//\t*" + sf.oneofTypeName + "\n"
-	}
-	g.P(comment, Annotate(mc.message.file, f.fullPath, f.goName), " ", f.goType, " `", f.tags, "`")
-}
-
-// getter for a oneof field will print additional discriminators and interfaces for the oneof,
-// also it prints all the getters for the sub fields.
-func (f *oneofField) getter(g *Generator, mc *msgCtx) {
-	// The discriminator type
-	g.P("type ", f.goType, " interface {")
-	g.P(f.goType, "()")
-	g.P("}")
-	g.P()
-	// The subField types, fulfilling the discriminator type contract
-	for _, sf := range f.subFields {
-		g.P("type ", Annotate(mc.message.file, sf.fullPath, sf.oneofTypeName), " struct {")
-		g.P(Annotate(mc.message.file, sf.fullPath, sf.goName), " ", sf.goType, " `", sf.tags, "`")
-		g.P("}")
-		g.P()
-	}
-	for _, sf := range f.subFields {
-		g.P("func (*", sf.oneofTypeName, ") ", f.goType, "() {}")
-		g.P()
-	}
-	// Getter for the oneof field
-	g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, f.fullPath, f.getterName), "() ", f.goType, " {")
-	g.P("if m != nil { return m.", f.goName, " }")
-	g.P("return nil")
-	g.P("}")
-	g.P()
-	// Getters for each oneof
-	for _, sf := range f.subFields {
-		if sf.deprecated != "" {
-			g.P(sf.deprecated)
-		}
-		g.P("func (m *", mc.goName, ") ", Annotate(mc.message.file, sf.fullPath, sf.getterName), "() "+sf.goType+" {")
-		g.P("if x, ok := m.", f.getterName, "().(*", sf.oneofTypeName, "); ok {")
-		g.P("return x.", sf.goName)
-		g.P("}")
-		g.P("return ", sf.getterDef)
-		g.P("}")
-		g.P()
-	}
-}
-
-// setter prints the setter method of the field.
-func (f *oneofField) setter(g *Generator, mc *msgCtx) {
-	// No setters for oneof yet
-}
-
-// topLevelField interface implemented by all types of fields on the top level (not oneofSubField).
-type topLevelField interface {
-	decl(g *Generator, mc *msgCtx)   // print declaration within the struct
-	getter(g *Generator, mc *msgCtx) // print getter
-	setter(g *Generator, mc *msgCtx) // print setter if applicable
-}
-
-// defField interface implemented by all types of fields that can have defaults (not oneofField, but instead oneofSubField).
-type defField interface {
-	getProtoDef() string                                // default value explicitly stated in the proto file, e.g "yoshi" or "5"
-	getProtoName() string                               // proto name of a field, e.g. "field_name" or "descriptor"
-	getGoType() string                                  // go type of the field  as a string, e.g. "*int32"
-	getProtoTypeName() string                           // protobuf type name for the field, e.g. ".google.protobuf.Duration"
-	getProtoType() descriptor.FieldDescriptorProto_Type // *field.Type value, e.g. descriptor.FieldDescriptorProto_TYPE_FIXED64
-}
-
-// generateDefaultConstants adds constants for default values if needed, which is only if the default value is.
-// explicit in the proto.
-func (g *Generator) generateDefaultConstants(mc *msgCtx, topLevelFields []topLevelField) {
-	// Collect fields that can have defaults
-	dFields := []defField{}
-	for _, pf := range topLevelFields {
-		if f, ok := pf.(*oneofField); ok {
-			for _, osf := range f.subFields {
-				dFields = append(dFields, osf)
-			}
-			continue
-		}
-		dFields = append(dFields, pf.(defField))
-	}
-	for _, df := range dFields {
-		def := df.getProtoDef()
-		if def == "" {
-			continue
-		}
-		fieldname := g.defaultConstantName(mc.goName, df.getProtoName())
-		typename := df.getGoType()
-		if typename[0] == '*' {
-			typename = typename[1:]
-		}
-		kind := "const "
-		switch {
-		case typename == "bool":
-		case typename == "string":
-			def = strconv.Quote(def)
-		case typename == "[]byte":
-			def = "[]byte(" + strconv.Quote(unescape(def)) + ")"
-			kind = "var "
-		case def == "inf", def == "-inf", def == "nan":
-			// These names are known to, and defined by, the protocol language.
-			switch def {
-			case "inf":
-				def = "math.Inf(1)"
-			case "-inf":
-				def = "math.Inf(-1)"
-			case "nan":
-				def = "math.NaN()"
-			}
-			if df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_FLOAT {
-				def = "float32(" + def + ")"
-			}
-			kind = "var "
-		case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_FLOAT:
-			if f, err := strconv.ParseFloat(def, 32); err == nil {
-				def = fmt.Sprint(float32(f))
-			}
-		case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_DOUBLE:
-			if f, err := strconv.ParseFloat(def, 64); err == nil {
-				def = fmt.Sprint(f)
-			}
-		case df.getProtoType() == descriptor.FieldDescriptorProto_TYPE_ENUM:
-			// Must be an enum.  Need to construct the prefixed name.
-			obj := g.ObjectNamed(df.getProtoTypeName())
-			var enum *EnumDescriptor
-			if id, ok := obj.(*ImportedDescriptor); ok {
-				// The enum type has been publicly imported.
-				enum, _ = id.o.(*EnumDescriptor)
-			} else {
-				enum, _ = obj.(*EnumDescriptor)
-			}
-			if enum == nil {
-				log.Printf("don't know how to generate constant for %s", fieldname)
-				continue
-			}
-			def = g.DefaultPackageName(obj) + enum.prefix() + def
-		}
-		g.P(kind, fieldname, " ", typename, " = ", def)
-		g.file.addExport(mc.message, constOrVarSymbol{fieldname, kind, ""})
-	}
-	g.P()
-}
-
-// generateInternalStructFields just adds the XXX_<something> fields to the message struct.
-func (g *Generator) generateInternalStructFields(mc *msgCtx, topLevelFields []topLevelField) {
-	g.P("XXX_NoUnkeyedLiteral\tstruct{} `json:\"-\"`") // prevent unkeyed struct literals
-	if len(mc.message.ExtensionRange) > 0 {
-		messageset := ""
-		if opts := mc.message.Options; opts != nil && opts.GetMessageSetWireFormat() {
-			messageset = "protobuf_messageset:\"1\" "
-		}
-		g.P(g.Pkg["proto"], ".XXX_InternalExtensions `", messageset, "json:\"-\"`")
-	}
-	g.P("XXX_unrecognized\t[]byte `json:\"-\"`")
-	g.P("XXX_sizecache\tint32 `json:\"-\"`")
-
-}
-
-// generateOneofFuncs adds all the utility functions for oneof, including marshalling, unmarshalling and sizer.
-func (g *Generator) generateOneofFuncs(mc *msgCtx, topLevelFields []topLevelField) {
-	ofields := []*oneofField{}
-	for _, f := range topLevelFields {
-		if o, ok := f.(*oneofField); ok {
-			ofields = append(ofields, o)
-		}
-	}
-	if len(ofields) == 0 {
-		return
-	}
-
-	// OneofFuncs
-	g.P("// XXX_OneofWrappers is for the internal use of the proto package.")
-	g.P("func (*", mc.goName, ") XXX_OneofWrappers() []interface{} {")
-	g.P("return []interface{}{")
-	for _, of := range ofields {
-		for _, sf := range of.subFields {
-			sf.typedNil(g)
-		}
-	}
-	g.P("}")
-	g.P("}")
-	g.P()
-}
-
-// generateMessageStruct adds the actual struct with it's members (but not methods) to the output.
-func (g *Generator) generateMessageStruct(mc *msgCtx, topLevelFields []topLevelField) {
-	comments := g.PrintComments(mc.message.path)
-
-	// Guarantee deprecation comments appear after user-provided comments.
-	if mc.message.GetOptions().GetDeprecated() {
-		if comments {
-			// Convention: Separate deprecation comments from original
-			// comments with an empty line.
-			g.P("//")
-		}
-		g.P(deprecationComment)
-	}
-
-	g.P("type ", Annotate(mc.message.file, mc.message.path, mc.goName), " struct {")
-	for _, pf := range topLevelFields {
-		pf.decl(g, mc)
-	}
-	g.generateInternalStructFields(mc, topLevelFields)
-	g.P("}")
-}
-
-// generateGetters adds getters for all fields, including oneofs and weak fields when applicable.
-func (g *Generator) generateGetters(mc *msgCtx, topLevelFields []topLevelField) {
-	for _, pf := range topLevelFields {
-		pf.getter(g, mc)
-	}
-}
-
-// generateSetters add setters for all fields, including oneofs and weak fields when applicable.
-func (g *Generator) generateSetters(mc *msgCtx, topLevelFields []topLevelField) {
-	for _, pf := range topLevelFields {
-		pf.setter(g, mc)
-	}
-}
-
-// generateCommonMethods adds methods to the message that are not on a per field basis.
-func (g *Generator) generateCommonMethods(mc *msgCtx) {
-	// Reset, String and ProtoMessage methods.
-	g.P("func (m *", mc.goName, ") Reset() { *m = ", mc.goName, "{} }")
-	g.P("func (m *", mc.goName, ") String() string { return ", g.Pkg["proto"], ".CompactTextString(m) }")
-	g.P("func (*", mc.goName, ") ProtoMessage() {}")
-	var indexes []string
-	for m := mc.message; m != nil; m = m.parent {
-		indexes = append([]string{strconv.Itoa(m.index)}, indexes...)
-	}
-	g.P("func (*", mc.goName, ") Descriptor() ([]byte, []int) {")
-	g.P("return ", g.file.VarName(), ", []int{", strings.Join(indexes, ", "), "}")
-	g.P("}")
-	g.P()
-	// TODO: Revisit the decision to use a XXX_WellKnownType method
-	// if we change proto.MessageName to work with multiple equivalents.
-	if mc.message.file.GetPackage() == "google.protobuf" && wellKnownTypes[mc.message.GetName()] {
-		g.P("func (*", mc.goName, `) XXX_WellKnownType() string { return "`, mc.message.GetName(), `" }`)
-		g.P()
-	}
-
-	// Extension support methods
-	if len(mc.message.ExtensionRange) > 0 {
-		g.P()
-		g.P("var extRange_", mc.goName, " = []", g.Pkg["proto"], ".ExtensionRange{")
-		for _, r := range mc.message.ExtensionRange {
-			end := fmt.Sprint(*r.End - 1) // make range inclusive on both ends
-			g.P("{Start: ", r.Start, ", End: ", end, "},")
-		}
-		g.P("}")
-		g.P("func (*", mc.goName, ") ExtensionRangeArray() []", g.Pkg["proto"], ".ExtensionRange {")
-		g.P("return extRange_", mc.goName)
-		g.P("}")
-		g.P()
-	}
-
-	// TODO: It does not scale to keep adding another method for every
-	// operation on protos that we want to switch over to using the
-	// table-driven approach. Instead, we should only add a single method
-	// that allows getting access to the *InternalMessageInfo struct and then
-	// calling Unmarshal, Marshal, Merge, Size, and Discard directly on that.
-
-	// Wrapper for table-driven marshaling and unmarshaling.
-	g.P("func (m *", mc.goName, ") XXX_Unmarshal(b []byte) error {")
-	g.P("return xxx_messageInfo_", mc.goName, ".Unmarshal(m, b)")
-	g.P("}")
-
-	g.P("func (m *", mc.goName, ") XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {")
-	g.P("return xxx_messageInfo_", mc.goName, ".Marshal(b, m, deterministic)")
-	g.P("}")
-
-	g.P("func (m *", mc.goName, ") XXX_Merge(src ", g.Pkg["proto"], ".Message) {")
-	g.P("xxx_messageInfo_", mc.goName, ".Merge(m, src)")
-	g.P("}")
-
-	g.P("func (m *", mc.goName, ") XXX_Size() int {") // avoid name clash with "Size" field in some message
-	g.P("return xxx_messageInfo_", mc.goName, ".Size(m)")
-	g.P("}")
-
-	g.P("func (m *", mc.goName, ") XXX_DiscardUnknown() {")
-	g.P("xxx_messageInfo_", mc.goName, ".DiscardUnknown(m)")
-	g.P("}")
-
-	g.P("var xxx_messageInfo_", mc.goName, " ", g.Pkg["proto"], ".InternalMessageInfo")
-	g.P()
-}
-
-// Generate the type, methods and default constant definitions for this Descriptor.
-func (g *Generator) generateMessage(message *Descriptor) {
-	topLevelFields := []topLevelField{}
-	oFields := make(map[int32]*oneofField)
-	// The full type name
-	typeName := message.TypeName()
-	// The full type name, CamelCased.
-	goTypeName := CamelCaseSlice(typeName)
-
-	usedNames := make(map[string]bool)
-	for _, n := range methodNames {
-		usedNames[n] = true
-	}
-
-	// allocNames finds a conflict-free variation of the given strings,
-	// consistently mutating their suffixes.
-	// It returns the same number of strings.
-	allocNames := func(ns ...string) []string {
-	Loop:
-		for {
-			for _, n := range ns {
-				if usedNames[n] {
-					for i := range ns {
-						ns[i] += "_"
-					}
-					continue Loop
-				}
-			}
-			for _, n := range ns {
-				usedNames[n] = true
-			}
-			return ns
-		}
-	}
-
-	mapFieldTypes := make(map[*descriptor.FieldDescriptorProto]string) // keep track of the map fields to be added later
-
-	// Build a structure more suitable for generating the text in one pass
-	for i, field := range message.Field {
-		// Allocate the getter and the field at the same time so name
-		// collisions create field/method consistent names.
-		// TODO: This allocation occurs based on the order of the fields
-		// in the proto file, meaning that a change in the field
-		// ordering can change generated Method/Field names.
-		base := CamelCase(*field.Name)
-		ns := allocNames(base, "Get"+base)
-		fieldName, fieldGetterName := ns[0], ns[1]
-		typename, wiretype := g.GoType(message, field)
-		jsonName := *field.Name
-		tag := fmt.Sprintf("protobuf:%s json:%q", g.goTag(message, field, wiretype), jsonName+",omitempty")
-
-		oneof := field.OneofIndex != nil
-		if oneof && oFields[*field.OneofIndex] == nil {
-			odp := message.OneofDecl[int(*field.OneofIndex)]
-			base := CamelCase(odp.GetName())
-			fname := allocNames(base)[0]
-
-			// This is the first field of a oneof we haven't seen before.
-			// Generate the union field.
-			oneofFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageOneofPath, *field.OneofIndex)
-			c, ok := g.makeComments(oneofFullPath)
-			if ok {
-				c += "\n//\n"
-			}
-			c += "// Types that are valid to be assigned to " + fname + ":\n"
-			// Generate the rest of this comment later,
-			// when we've computed any disambiguation.
-
-			dname := "is" + goTypeName + "_" + fname
-			tag := `protobuf_oneof:"` + odp.GetName() + `"`
-			of := oneofField{
-				fieldCommon: fieldCommon{
-					goName:     fname,
-					getterName: "Get"+fname,
-					goType:     dname,
-					tags:       tag,
-					protoName:  odp.GetName(),
-					fullPath:   oneofFullPath,
-				},
-				comment: c,
-			}
-			topLevelFields = append(topLevelFields, &of)
-			oFields[*field.OneofIndex] = &of
-		}
-
-		if *field.Type == descriptor.FieldDescriptorProto_TYPE_MESSAGE {
-			desc := g.ObjectNamed(field.GetTypeName())
-			if d, ok := desc.(*Descriptor); ok && d.GetOptions().GetMapEntry() {
-				// Figure out the Go types and tags for the key and value types.
-				keyField, valField := d.Field[0], d.Field[1]
-				keyType, keyWire := g.GoType(d, keyField)
-				valType, valWire := g.GoType(d, valField)
-				keyTag, valTag := g.goTag(d, keyField, keyWire), g.goTag(d, valField, valWire)
-
-				// We don't use stars, except for message-typed values.
-				// Message and enum types are the only two possibly foreign types used in maps,
-				// so record their use. They are not permitted as map keys.
-				keyType = strings.TrimPrefix(keyType, "*")
-				switch *valField.Type {
-				case descriptor.FieldDescriptorProto_TYPE_ENUM:
-					valType = strings.TrimPrefix(valType, "*")
-					g.RecordTypeUse(valField.GetTypeName())
-				case descriptor.FieldDescriptorProto_TYPE_MESSAGE:
-					g.RecordTypeUse(valField.GetTypeName())
-				default:
-					valType = strings.TrimPrefix(valType, "*")
-				}
-
-				typename = fmt.Sprintf("map[%s]%s", keyType, valType)
-				mapFieldTypes[field] = typename // record for the getter generation
-
-				tag += fmt.Sprintf(" protobuf_key:%s protobuf_val:%s", keyTag, valTag)
-			}
-		}
-
-		fieldDeprecated := ""
-		if field.GetOptions().GetDeprecated() {
-			fieldDeprecated = deprecationComment
-		}
-
-		dvalue := g.getterDefault(field, goTypeName)
-		if oneof {
-			tname := goTypeName + "_" + fieldName
-			// It is possible for this to collide with a message or enum
-			// nested in this message. Check for collisions.
-			for {
-				ok := true
-				for _, desc := range message.nested {
-					if CamelCaseSlice(desc.TypeName()) == tname {
-						ok = false
-						break
-					}
-				}
-				for _, enum := range message.enums {
-					if CamelCaseSlice(enum.TypeName()) == tname {
-						ok = false
-						break
-					}
-				}
-				if !ok {
-					tname += "_"
-					continue
-				}
-				break
-			}
-
-			oneofField := oFields[*field.OneofIndex]
-			tag := "protobuf:" + g.goTag(message, field, wiretype)
-			sf := oneofSubField{
-				fieldCommon: fieldCommon{
-					goName:     fieldName,
-					getterName: fieldGetterName,
-					goType:     typename,
-					tags:       tag,
-					protoName:  field.GetName(),
-					fullPath:   fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i),
-				},
-				protoTypeName: field.GetTypeName(),
-				fieldNumber:   int(*field.Number),
-				protoType:     *field.Type,
-				getterDef:     dvalue,
-				protoDef:      field.GetDefaultValue(),
-				oneofTypeName: tname,
-				deprecated:    fieldDeprecated,
-			}
-			oneofField.subFields = append(oneofField.subFields, &sf)
-			g.RecordTypeUse(field.GetTypeName())
-			continue
-		}
-
-		fieldFullPath := fmt.Sprintf("%s,%d,%d", message.path, messageFieldPath, i)
-		c, ok := g.makeComments(fieldFullPath)
-		if ok {
-			c += "\n"
-		}
-		rf := simpleField{
-			fieldCommon: fieldCommon{
-				goName:     fieldName,
-				getterName: fieldGetterName,
-				goType:     typename,
-				tags:       tag,
-				protoName:  field.GetName(),
-				fullPath:   fieldFullPath,
-			},
-			protoTypeName: field.GetTypeName(),
-			protoType:     *field.Type,
-			deprecated:    fieldDeprecated,
-			getterDef:     dvalue,
-			protoDef:      field.GetDefaultValue(),
-			comment:       c,
-		}
-		var pf topLevelField = &rf
-
-		topLevelFields = append(topLevelFields, pf)
-		g.RecordTypeUse(field.GetTypeName())
-	}
-
-	mc := &msgCtx{
-		goName:  goTypeName,
-		message: message,
-	}
-
-	g.generateMessageStruct(mc, topLevelFields)
-	g.P()
-	g.generateCommonMethods(mc)
-	g.P()
-	g.generateDefaultConstants(mc, topLevelFields)
-	g.P()
-	g.generateGetters(mc, topLevelFields)
-	g.P()
-	g.generateSetters(mc, topLevelFields)
-	g.P()
-	g.generateOneofFuncs(mc, topLevelFields)
-	g.P()
-
-	var oneofTypes []string
-	for _, f := range topLevelFields {
-		if of, ok := f.(*oneofField); ok {
-			for _, osf := range of.subFields {
-				oneofTypes = append(oneofTypes, osf.oneofTypeName)
-			}
-		}
-	}
-
-	opts := message.Options
-	ms := &messageSymbol{
-		sym:           goTypeName,
-		hasExtensions: len(message.ExtensionRange) > 0,
-		isMessageSet:  opts != nil && opts.GetMessageSetWireFormat(),
-		oneofTypes:    oneofTypes,
-	}
-	g.file.addExport(message, ms)
-
-	for _, ext := range message.ext {
-		g.generateExtension(ext)
-	}
-
-	fullName := strings.Join(message.TypeName(), ".")
-	if g.file.Package != nil {
-		fullName = *g.file.Package + "." + fullName
-	}
-
-	g.addInitf("%s.RegisterType((*%s)(nil), %q)", g.Pkg["proto"], goTypeName, fullName)
-	// Register types for native map types.
-	for _, k := range mapFieldKeys(mapFieldTypes) {
-		fullName := strings.TrimPrefix(*k.TypeName, ".")
-		g.addInitf("%s.RegisterMapType((%s)(nil), %q)", g.Pkg["proto"], mapFieldTypes[k], fullName)
-	}
-
-}
-
-type byTypeName []*descriptor.FieldDescriptorProto
-
-func (a byTypeName) Len() int           { return len(a) }
-func (a byTypeName) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
-func (a byTypeName) Less(i, j int) bool { return *a[i].TypeName < *a[j].TypeName }
-
-// mapFieldKeys returns the keys of m in a consistent order.
-func mapFieldKeys(m map[*descriptor.FieldDescriptorProto]string) []*descriptor.FieldDescriptorProto {
-	keys := make([]*descriptor.FieldDescriptorProto, 0, len(m))
-	for k := range m {
-		keys = append(keys, k)
-	}
-	sort.Sort(byTypeName(keys))
-	return keys
-}
-
-var escapeChars = [256]byte{
-	'a': '\a', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', 'v': '\v', '\\': '\\', '"': '"', '\'': '\'', '?': '?',
-}
-
-// unescape reverses the "C" escaping that protoc does for default values of bytes fields.
-// It is best effort in that it effectively ignores malformed input. Seemingly invalid escape
-// sequences are conveyed, unmodified, into the decoded result.
-func unescape(s string) string {
-	// NB: Sadly, we can't use strconv.Unquote because protoc will escape both
-	// single and double quotes, but strconv.Unquote only allows one or the
-	// other (based on actual surrounding quotes of its input argument).
-
-	var out []byte
-	for len(s) > 0 {
-		// regular character, or too short to be valid escape
-		if s[0] != '\\' || len(s) < 2 {
-			out = append(out, s[0])
-			s = s[1:]
-		} else if c := escapeChars[s[1]]; c != 0 {
-			// escape sequence
-			out = append(out, c)
-			s = s[2:]
-		} else if s[1] == 'x' || s[1] == 'X' {
-			// hex escape, e.g. "\x80
-			if len(s) < 4 {
-				// too short to be valid
-				out = append(out, s[:2]...)
-				s = s[2:]
-				continue
-			}
-			v, err := strconv.ParseUint(s[2:4], 16, 8)
-			if err != nil {
-				out = append(out, s[:4]...)
-			} else {
-				out = append(out, byte(v))
-			}
-			s = s[4:]
-		} else if '0' <= s[1] && s[1] <= '7' {
-			// octal escape, can vary from 1 to 3 octal digits; e.g., "\0" "\40" or "\164"
-			// so consume up to 2 more bytes or up to end-of-string
-			n := len(s[1:]) - len(strings.TrimLeft(s[1:], "01234567"))
-			if n > 3 {
-				n = 3
-			}
-			v, err := strconv.ParseUint(s[1:1+n], 8, 8)
-			if err != nil {
-				out = append(out, s[:1+n]...)
-			} else {
-				out = append(out, byte(v))
-			}
-			s = s[1+n:]
-		} else {
-			// bad escape, just propagate the slash as-is
-			out = append(out, s[0])
-			s = s[1:]
-		}
-	}
-
-	return string(out)
-}
-
-func (g *Generator) generateExtension(ext *ExtensionDescriptor) {
-	ccTypeName := ext.DescName()
-
-	extObj := g.ObjectNamed(*ext.Extendee)
-	var extDesc *Descriptor
-	if id, ok := extObj.(*ImportedDescriptor); ok {
-		// This is extending a publicly imported message.
-		// We need the underlying type for goTag.
-		extDesc = id.o.(*Descriptor)
-	} else {
-		extDesc = extObj.(*Descriptor)
-	}
-	extendedType := "*" + g.TypeName(extObj) // always use the original
-	field := ext.FieldDescriptorProto
-	fieldType, wireType := g.GoType(ext.parent, field)
-	tag := g.goTag(extDesc, field, wireType)
-	g.RecordTypeUse(*ext.Extendee)
-	if n := ext.FieldDescriptorProto.TypeName; n != nil {
-		// foreign extension type
-		g.RecordTypeUse(*n)
-	}
-
-	typeName := ext.TypeName()
-
-	// Special case for proto2 message sets: If this extension is extending
-	// proto2.bridge.MessageSet, and its final name component is "message_set_extension",
-	// then drop that last component.
-	//
-	// TODO: This should be implemented in the text formatter rather than the generator.
-	// In addition, the situation for when to apply this special case is implemented
-	// differently in other languages:
-	// https://github.com/google/protobuf/blob/aff10976/src/google/protobuf/text_format.cc#L1560
-	if extDesc.GetOptions().GetMessageSetWireFormat() && typeName[len(typeName)-1] == "message_set_extension" {
-		typeName = typeName[:len(typeName)-1]
-	}
-
-	// For text formatting, the package must be exactly what the .proto file declares,
-	// ignoring overrides such as the go_package option, and with no dot/underscore mapping.
-	extName := strings.Join(typeName, ".")
-	if g.file.Package != nil {
-		extName = *g.file.Package + "." + extName
-	}
-
-	g.P("var ", ccTypeName, " = &", g.Pkg["proto"], ".ExtensionDesc{")
-	g.P("ExtendedType: (", extendedType, ")(nil),")
-	g.P("ExtensionType: (", fieldType, ")(nil),")
-	g.P("Field: ", field.Number, ",")
-	g.P(`Name: "`, extName, `",`)
-	g.P("Tag: ", tag, ",")
-	g.P(`Filename: "`, g.file.GetName(), `",`)
-
-	g.P("}")
-	g.P()
-
-	g.addInitf("%s.RegisterExtension(%s)", g.Pkg["proto"], ext.DescName())
-
-	g.file.addExport(ext, constOrVarSymbol{ccTypeName, "var", ""})
-}
-
-func (g *Generator) generateInitFunction() {
-	if len(g.init) == 0 {
-		return
-	}
-	g.P("func init() {")
-	for _, l := range g.init {
-		g.P(l)
-	}
-	g.P("}")
-	g.init = nil
-}
-
-func (g *Generator) generateFileDescriptor(file *FileDescriptor) {
-	// Make a copy and trim source_code_info data.
-	// TODO: Trim this more when we know exactly what we need.
-	pb := proto.Clone(file.FileDescriptorProto).(*descriptor.FileDescriptorProto)
-	pb.SourceCodeInfo = nil
-
-	b, err := proto.Marshal(pb)
-	if err != nil {
-		g.Fail(err.Error())
-	}
-
-	var buf bytes.Buffer
-	w, _ := gzip.NewWriterLevel(&buf, gzip.BestCompression)
-	w.Write(b)
-	w.Close()
-	b = buf.Bytes()
-
-	v := file.VarName()
-	g.P()
-	g.P("func init() { ", g.Pkg["proto"], ".RegisterFile(", strconv.Quote(*file.Name), ", ", v, ") }")
-	g.P("var ", v, " = []byte{")
-	g.P("// ", len(b), " bytes of a gzipped FileDescriptorProto")
-	for len(b) > 0 {
-		n := 16
-		if n > len(b) {
-			n = len(b)
-		}
-
-		s := ""
-		for _, c := range b[:n] {
-			s += fmt.Sprintf("0x%02x,", c)
-		}
-		g.P(s)
-
-		b = b[n:]
-	}
-	g.P("}")
-}
-
-func (g *Generator) generateEnumRegistration(enum *EnumDescriptor) {
-	// // We always print the full (proto-world) package name here.
-	pkg := enum.File().GetPackage()
-	if pkg != "" {
-		pkg += "."
-	}
-	// The full type name
-	typeName := enum.TypeName()
-	// The full type name, CamelCased.
-	ccTypeName := CamelCaseSlice(typeName)
-	g.addInitf("%s.RegisterEnum(%q, %[3]s_name, %[3]s_value)", g.Pkg["proto"], pkg+ccTypeName, ccTypeName)
-}
-
-// And now lots of helper functions.
-
-// Is c an ASCII lower-case letter?
-func isASCIILower(c byte) bool {
-	return 'a' <= c && c <= 'z'
-}
-
-// Is c an ASCII digit?
-func isASCIIDigit(c byte) bool {
-	return '0' <= c && c <= '9'
-}
-
-// CamelCase returns the CamelCased name.
-// If there is an interior underscore followed by a lower case letter,
-// drop the underscore and convert the letter to upper case.
-// There is a remote possibility of this rewrite causing a name collision,
-// but it's so remote we're prepared to pretend it's nonexistent - since the
-// C++ generator lowercases names, it's extremely unlikely to have two fields
-// with different capitalizations.
-// In short, _my_field_name_2 becomes XMyFieldName_2.
-func CamelCase(s string) string {
-	if s == "" {
-		return ""
-	}
-	t := make([]byte, 0, 32)
-	i := 0
-	if s[0] == '_' {
-		// Need a capital letter; drop the '_'.
-		t = append(t, 'X')
-		i++
-	}
-	// Invariant: if the next letter is lower case, it must be converted
-	// to upper case.
-	// That is, we process a word at a time, where words are marked by _ or
-	// upper case letter. Digits are treated as words.
-	for ; i < len(s); i++ {
-		c := s[i]
-		if c == '_' && i+1 < len(s) && isASCIILower(s[i+1]) {
-			continue // Skip the underscore in s.
-		}
-		if isASCIIDigit(c) {
-			t = append(t, c)
-			continue
-		}
-		// Assume we have a letter now - if not, it's a bogus identifier.
-		// The next word is a sequence of characters that must start upper case.
-		if isASCIILower(c) {
-			c ^= ' ' // Make it a capital letter.
-		}
-		t = append(t, c) // Guaranteed not lower case.
-		// Accept lower case sequence that follows.
-		for i+1 < len(s) && isASCIILower(s[i+1]) {
-			i++
-			t = append(t, s[i])
-		}
-	}
-	return string(t)
-}
-
-// CamelCaseSlice is like CamelCase, but the argument is a slice of strings to
-// be joined with "_".
-func CamelCaseSlice(elem []string) string { return CamelCase(strings.Join(elem, "_")) }
-
-// dottedSlice turns a sliced name into a dotted name.
-func dottedSlice(elem []string) string { return strings.Join(elem, ".") }
-
-// Is this field optional?
-func isOptional(field *descriptor.FieldDescriptorProto) bool {
-	return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_OPTIONAL
-}
-
-// Is this field required?
-func isRequired(field *descriptor.FieldDescriptorProto) bool {
-	return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REQUIRED
-}
-
-// Is this field repeated?
-func isRepeated(field *descriptor.FieldDescriptorProto) bool {
-	return field.Label != nil && *field.Label == descriptor.FieldDescriptorProto_LABEL_REPEATED
-}
-
-// Is this field a scalar numeric type?
-func isScalar(field *descriptor.FieldDescriptorProto) bool {
-	if field.Type == nil {
-		return false
-	}
-	switch *field.Type {
-	case descriptor.FieldDescriptorProto_TYPE_DOUBLE,
-		descriptor.FieldDescriptorProto_TYPE_FLOAT,
-		descriptor.FieldDescriptorProto_TYPE_INT64,
-		descriptor.FieldDescriptorProto_TYPE_UINT64,
-		descriptor.FieldDescriptorProto_TYPE_INT32,
-		descriptor.FieldDescriptorProto_TYPE_FIXED64,
-		descriptor.FieldDescriptorProto_TYPE_FIXED32,
-		descriptor.FieldDescriptorProto_TYPE_BOOL,
-		descriptor.FieldDescriptorProto_TYPE_UINT32,
-		descriptor.FieldDescriptorProto_TYPE_ENUM,
-		descriptor.FieldDescriptorProto_TYPE_SFIXED32,
-		descriptor.FieldDescriptorProto_TYPE_SFIXED64,
-		descriptor.FieldDescriptorProto_TYPE_SINT32,
-		descriptor.FieldDescriptorProto_TYPE_SINT64:
-		return true
-	default:
-		return false
-	}
-}
-
-// badToUnderscore is the mapping function used to generate Go names from package names,
-// which can be dotted in the input .proto file.  It replaces non-identifier characters such as
-// dot or dash with underscore.
-func badToUnderscore(r rune) rune {
-	if unicode.IsLetter(r) || unicode.IsDigit(r) || r == '_' {
-		return r
-	}
-	return '_'
-}
-
-// baseName returns the last path element of the name, with the last dotted suffix removed.
-func baseName(name string) string {
-	// First, find the last element
-	if i := strings.LastIndex(name, "/"); i >= 0 {
-		name = name[i+1:]
-	}
-	// Now drop the suffix
-	if i := strings.LastIndex(name, "."); i >= 0 {
-		name = name[0:i]
-	}
-	return name
-}
-
-// The SourceCodeInfo message describes the location of elements of a parsed
-// .proto file by way of a "path", which is a sequence of integers that
-// describe the route from a FileDescriptorProto to the relevant submessage.
-// The path alternates between a field number of a repeated field, and an index
-// into that repeated field. The constants below define the field numbers that
-// are used.
-//
-// See descriptor.proto for more information about this.
-const (
-	// tag numbers in FileDescriptorProto
-	packagePath = 2 // package
-	messagePath = 4 // message_type
-	enumPath    = 5 // enum_type
-	// tag numbers in DescriptorProto
-	messageFieldPath   = 2 // field
-	messageMessagePath = 3 // nested_type
-	messageEnumPath    = 4 // enum_type
-	messageOneofPath   = 8 // oneof_decl
-	// tag numbers in EnumDescriptorProto
-	enumValuePath = 2 // value
-)
-
-var supportTypeAliases bool
-
-func init() {
-	for _, tag := range build.Default.ReleaseTags {
-		if tag == "go1.9" {
-			supportTypeAliases = true
-			return
-		}
-	}
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go b/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
deleted file mode 100644
index a9b6103..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/generator/internal/remap/remap.go
+++ /dev/null
@@ -1,117 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2017 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-/*
-Package remap handles tracking the locations of Go tokens in a source text
-across a rewrite by the Go formatter.
-*/
-package remap
-
-import (
-	"fmt"
-	"go/scanner"
-	"go/token"
-)
-
-// A Location represents a span of byte offsets in the source text.
-type Location struct {
-	Pos, End int // End is exclusive
-}
-
-// A Map represents a mapping between token locations in an input source text
-// and locations in the correspnding output text.
-type Map map[Location]Location
-
-// Find reports whether the specified span is recorded by m, and if so returns
-// the new location it was mapped to. If the input span was not found, the
-// returned location is the same as the input.
-func (m Map) Find(pos, end int) (Location, bool) {
-	key := Location{
-		Pos: pos,
-		End: end,
-	}
-	if loc, ok := m[key]; ok {
-		return loc, true
-	}
-	return key, false
-}
-
-func (m Map) add(opos, oend, npos, nend int) {
-	m[Location{Pos: opos, End: oend}] = Location{Pos: npos, End: nend}
-}
-
-// Compute constructs a location mapping from input to output.  An error is
-// reported if any of the tokens of output cannot be mapped.
-func Compute(input, output []byte) (Map, error) {
-	itok := tokenize(input)
-	otok := tokenize(output)
-	if len(itok) != len(otok) {
-		return nil, fmt.Errorf("wrong number of tokens, %d ≠ %d", len(itok), len(otok))
-	}
-	m := make(Map)
-	for i, ti := range itok {
-		to := otok[i]
-		if ti.Token != to.Token {
-			return nil, fmt.Errorf("token %d type mismatch: %s ≠ %s", i+1, ti, to)
-		}
-		m.add(ti.pos, ti.end, to.pos, to.end)
-	}
-	return m, nil
-}
-
-// tokinfo records the span and type of a source token.
-type tokinfo struct {
-	pos, end int
-	token.Token
-}
-
-func tokenize(src []byte) []tokinfo {
-	fs := token.NewFileSet()
-	var s scanner.Scanner
-	s.Init(fs.AddFile("src", fs.Base(), len(src)), src, nil, scanner.ScanComments)
-	var info []tokinfo
-	for {
-		pos, next, lit := s.Scan()
-		switch next {
-		case token.SEMICOLON:
-			continue
-		}
-		info = append(info, tokinfo{
-			pos:   int(pos - 1),
-			end:   int(pos + token.Pos(len(lit)) - 1),
-			Token: next,
-		})
-		if next == token.EOF {
-			break
-		}
-	}
-	return info
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go
deleted file mode 100644
index 1ddfe83..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/grpc/grpc.go
+++ /dev/null
@@ -1,476 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Package grpc outputs gRPC service descriptions in Go code.
-// It runs as a plugin for the Go protocol buffer compiler plugin.
-// It is linked in to protoc-gen-go.
-package grpc
-
-import (
-	"fmt"
-	"strconv"
-	"strings"
-
-	pb "github.com/golang/protobuf/protoc-gen-go/descriptor"
-	"github.com/golang/protobuf/protoc-gen-go/generator"
-)
-
-// generatedCodeVersion indicates a version of the generated code.
-// It is incremented whenever an incompatibility between the generated code and
-// the grpc package is introduced; the generated code references
-// a constant, grpc.SupportPackageIsVersionN (where N is generatedCodeVersion).
-const generatedCodeVersion = 4
-
-// Paths for packages used by code generated in this file,
-// relative to the import_prefix of the generator.Generator.
-const (
-	contextPkgPath = "context"
-	grpcPkgPath    = "google.golang.org/grpc"
-)
-
-func init() {
-	generator.RegisterPlugin(new(grpc))
-}
-
-// grpc is an implementation of the Go protocol buffer compiler's
-// plugin architecture.  It generates bindings for gRPC support.
-type grpc struct {
-	gen *generator.Generator
-}
-
-// Name returns the name of this plugin, "grpc".
-func (g *grpc) Name() string {
-	return "grpc"
-}
-
-// The names for packages imported in the generated code.
-// They may vary from the final path component of the import path
-// if the name is used by other packages.
-var (
-	contextPkg string
-	grpcPkg    string
-)
-
-// Init initializes the plugin.
-func (g *grpc) Init(gen *generator.Generator) {
-	g.gen = gen
-}
-
-// Given a type name defined in a .proto, return its object.
-// Also record that we're using it, to guarantee the associated import.
-func (g *grpc) objectNamed(name string) generator.Object {
-	g.gen.RecordTypeUse(name)
-	return g.gen.ObjectNamed(name)
-}
-
-// Given a type name defined in a .proto, return its name as we will print it.
-func (g *grpc) typeName(str string) string {
-	return g.gen.TypeName(g.objectNamed(str))
-}
-
-// P forwards to g.gen.P.
-func (g *grpc) P(args ...interface{}) { g.gen.P(args...) }
-
-// Generate generates code for the services in the given file.
-func (g *grpc) Generate(file *generator.FileDescriptor) {
-	if len(file.FileDescriptorProto.Service) == 0 {
-		return
-	}
-
-	contextPkg = string(g.gen.AddImport(contextPkgPath))
-	grpcPkg = string(g.gen.AddImport(grpcPkgPath))
-
-	g.P("// Reference imports to suppress errors if they are not otherwise used.")
-	g.P("var _ ", contextPkg, ".Context")
-	g.P("var _ ", grpcPkg, ".ClientConn")
-	g.P()
-
-	// Assert version compatibility.
-	g.P("// This is a compile-time assertion to ensure that this generated file")
-	g.P("// is compatible with the grpc package it is being compiled against.")
-	g.P("const _ = ", grpcPkg, ".SupportPackageIsVersion", generatedCodeVersion)
-	g.P()
-
-	for i, service := range file.FileDescriptorProto.Service {
-		g.generateService(file, service, i)
-	}
-}
-
-// GenerateImports generates the import declaration for this file.
-func (g *grpc) GenerateImports(file *generator.FileDescriptor) {
-}
-
-// reservedClientName records whether a client name is reserved on the client side.
-var reservedClientName = map[string]bool{
-	// TODO: do we need any in gRPC?
-}
-
-func unexport(s string) string { return strings.ToLower(s[:1]) + s[1:] }
-
-// deprecationComment is the standard comment added to deprecated
-// messages, fields, enums, and enum values.
-var deprecationComment = "// Deprecated: Do not use."
-
-// generateService generates all the code for the named service.
-func (g *grpc) generateService(file *generator.FileDescriptor, service *pb.ServiceDescriptorProto, index int) {
-	path := fmt.Sprintf("6,%d", index) // 6 means service.
-
-	origServName := service.GetName()
-	fullServName := origServName
-	if pkg := file.GetPackage(); pkg != "" {
-		fullServName = pkg + "." + fullServName
-	}
-	servName := generator.CamelCase(origServName)
-	deprecated := service.GetOptions().GetDeprecated()
-
-	g.P()
-	g.P(fmt.Sprintf(`// %sClient is the client API for %s service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.`, servName, servName))
-
-	// Client interface.
-	if deprecated {
-		g.P("//")
-		g.P(deprecationComment)
-	}
-	g.P("type ", servName, "Client interface {")
-	for i, method := range service.Method {
-		g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
-		g.P(g.generateClientSignature(servName, method))
-	}
-	g.P("}")
-	g.P()
-
-	// Client structure.
-	g.P("type ", unexport(servName), "Client struct {")
-	g.P("cc *", grpcPkg, ".ClientConn")
-	g.P("}")
-	g.P()
-
-	// NewClient factory.
-	if deprecated {
-		g.P(deprecationComment)
-	}
-	g.P("func New", servName, "Client (cc *", grpcPkg, ".ClientConn) ", servName, "Client {")
-	g.P("return &", unexport(servName), "Client{cc}")
-	g.P("}")
-	g.P()
-
-	var methodIndex, streamIndex int
-	serviceDescVar := "_" + servName + "_serviceDesc"
-	// Client method implementations.
-	for _, method := range service.Method {
-		var descExpr string
-		if !method.GetServerStreaming() && !method.GetClientStreaming() {
-			// Unary RPC method
-			descExpr = fmt.Sprintf("&%s.Methods[%d]", serviceDescVar, methodIndex)
-			methodIndex++
-		} else {
-			// Streaming RPC method
-			descExpr = fmt.Sprintf("&%s.Streams[%d]", serviceDescVar, streamIndex)
-			streamIndex++
-		}
-		g.generateClientMethod(servName, fullServName, serviceDescVar, method, descExpr)
-	}
-
-	// Server interface.
-	serverType := servName + "Server"
-	g.P("// ", serverType, " is the server API for ", servName, " service.")
-	if deprecated {
-		g.P("//")
-		g.P(deprecationComment)
-	}
-	g.P("type ", serverType, " interface {")
-	for i, method := range service.Method {
-		g.gen.PrintComments(fmt.Sprintf("%s,2,%d", path, i)) // 2 means method in a service.
-		g.P(g.generateServerSignature(servName, method))
-	}
-	g.P("}")
-	g.P()
-
-	// Server registration.
-	if deprecated {
-		g.P(deprecationComment)
-	}
-	g.P("func Register", servName, "Server(s *", grpcPkg, ".Server, srv ", serverType, ") {")
-	g.P("s.RegisterService(&", serviceDescVar, `, srv)`)
-	g.P("}")
-	g.P()
-
-	// Server handler implementations.
-	var handlerNames []string
-	for _, method := range service.Method {
-		hname := g.generateServerMethod(servName, fullServName, method)
-		handlerNames = append(handlerNames, hname)
-	}
-
-	// Service descriptor.
-	g.P("var ", serviceDescVar, " = ", grpcPkg, ".ServiceDesc {")
-	g.P("ServiceName: ", strconv.Quote(fullServName), ",")
-	g.P("HandlerType: (*", serverType, ")(nil),")
-	g.P("Methods: []", grpcPkg, ".MethodDesc{")
-	for i, method := range service.Method {
-		if method.GetServerStreaming() || method.GetClientStreaming() {
-			continue
-		}
-		g.P("{")
-		g.P("MethodName: ", strconv.Quote(method.GetName()), ",")
-		g.P("Handler: ", handlerNames[i], ",")
-		g.P("},")
-	}
-	g.P("},")
-	g.P("Streams: []", grpcPkg, ".StreamDesc{")
-	for i, method := range service.Method {
-		if !method.GetServerStreaming() && !method.GetClientStreaming() {
-			continue
-		}
-		g.P("{")
-		g.P("StreamName: ", strconv.Quote(method.GetName()), ",")
-		g.P("Handler: ", handlerNames[i], ",")
-		if method.GetServerStreaming() {
-			g.P("ServerStreams: true,")
-		}
-		if method.GetClientStreaming() {
-			g.P("ClientStreams: true,")
-		}
-		g.P("},")
-	}
-	g.P("},")
-	g.P("Metadata: \"", file.GetName(), "\",")
-	g.P("}")
-	g.P()
-}
-
-// generateClientSignature returns the client-side signature for a method.
-func (g *grpc) generateClientSignature(servName string, method *pb.MethodDescriptorProto) string {
-	origMethName := method.GetName()
-	methName := generator.CamelCase(origMethName)
-	if reservedClientName[methName] {
-		methName += "_"
-	}
-	reqArg := ", in *" + g.typeName(method.GetInputType())
-	if method.GetClientStreaming() {
-		reqArg = ""
-	}
-	respName := "*" + g.typeName(method.GetOutputType())
-	if method.GetServerStreaming() || method.GetClientStreaming() {
-		respName = servName + "_" + generator.CamelCase(origMethName) + "Client"
-	}
-	return fmt.Sprintf("%s(ctx %s.Context%s, opts ...%s.CallOption) (%s, error)", methName, contextPkg, reqArg, grpcPkg, respName)
-}
-
-func (g *grpc) generateClientMethod(servName, fullServName, serviceDescVar string, method *pb.MethodDescriptorProto, descExpr string) {
-	sname := fmt.Sprintf("/%s/%s", fullServName, method.GetName())
-	methName := generator.CamelCase(method.GetName())
-	inType := g.typeName(method.GetInputType())
-	outType := g.typeName(method.GetOutputType())
-
-	if method.GetOptions().GetDeprecated() {
-		g.P(deprecationComment)
-	}
-	g.P("func (c *", unexport(servName), "Client) ", g.generateClientSignature(servName, method), "{")
-	if !method.GetServerStreaming() && !method.GetClientStreaming() {
-		g.P("out := new(", outType, ")")
-		// TODO: Pass descExpr to Invoke.
-		g.P(`err := c.cc.Invoke(ctx, "`, sname, `", in, out, opts...)`)
-		g.P("if err != nil { return nil, err }")
-		g.P("return out, nil")
-		g.P("}")
-		g.P()
-		return
-	}
-	streamType := unexport(servName) + methName + "Client"
-	g.P("stream, err := c.cc.NewStream(ctx, ", descExpr, `, "`, sname, `", opts...)`)
-	g.P("if err != nil { return nil, err }")
-	g.P("x := &", streamType, "{stream}")
-	if !method.GetClientStreaming() {
-		g.P("if err := x.ClientStream.SendMsg(in); err != nil { return nil, err }")
-		g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }")
-	}
-	g.P("return x, nil")
-	g.P("}")
-	g.P()
-
-	genSend := method.GetClientStreaming()
-	genRecv := method.GetServerStreaming()
-	genCloseAndRecv := !method.GetServerStreaming()
-
-	// Stream auxiliary types and methods.
-	g.P("type ", servName, "_", methName, "Client interface {")
-	if genSend {
-		g.P("Send(*", inType, ") error")
-	}
-	if genRecv {
-		g.P("Recv() (*", outType, ", error)")
-	}
-	if genCloseAndRecv {
-		g.P("CloseAndRecv() (*", outType, ", error)")
-	}
-	g.P(grpcPkg, ".ClientStream")
-	g.P("}")
-	g.P()
-
-	g.P("type ", streamType, " struct {")
-	g.P(grpcPkg, ".ClientStream")
-	g.P("}")
-	g.P()
-
-	if genSend {
-		g.P("func (x *", streamType, ") Send(m *", inType, ") error {")
-		g.P("return x.ClientStream.SendMsg(m)")
-		g.P("}")
-		g.P()
-	}
-	if genRecv {
-		g.P("func (x *", streamType, ") Recv() (*", outType, ", error) {")
-		g.P("m := new(", outType, ")")
-		g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }")
-		g.P("return m, nil")
-		g.P("}")
-		g.P()
-	}
-	if genCloseAndRecv {
-		g.P("func (x *", streamType, ") CloseAndRecv() (*", outType, ", error) {")
-		g.P("if err := x.ClientStream.CloseSend(); err != nil { return nil, err }")
-		g.P("m := new(", outType, ")")
-		g.P("if err := x.ClientStream.RecvMsg(m); err != nil { return nil, err }")
-		g.P("return m, nil")
-		g.P("}")
-		g.P()
-	}
-}
-
-// generateServerSignature returns the server-side signature for a method.
-func (g *grpc) generateServerSignature(servName string, method *pb.MethodDescriptorProto) string {
-	origMethName := method.GetName()
-	methName := generator.CamelCase(origMethName)
-	if reservedClientName[methName] {
-		methName += "_"
-	}
-
-	var reqArgs []string
-	ret := "error"
-	if !method.GetServerStreaming() && !method.GetClientStreaming() {
-		reqArgs = append(reqArgs, contextPkg+".Context")
-		ret = "(*" + g.typeName(method.GetOutputType()) + ", error)"
-	}
-	if !method.GetClientStreaming() {
-		reqArgs = append(reqArgs, "*"+g.typeName(method.GetInputType()))
-	}
-	if method.GetServerStreaming() || method.GetClientStreaming() {
-		reqArgs = append(reqArgs, servName+"_"+generator.CamelCase(origMethName)+"Server")
-	}
-
-	return methName + "(" + strings.Join(reqArgs, ", ") + ") " + ret
-}
-
-func (g *grpc) generateServerMethod(servName, fullServName string, method *pb.MethodDescriptorProto) string {
-	methName := generator.CamelCase(method.GetName())
-	hname := fmt.Sprintf("_%s_%s_Handler", servName, methName)
-	inType := g.typeName(method.GetInputType())
-	outType := g.typeName(method.GetOutputType())
-
-	if !method.GetServerStreaming() && !method.GetClientStreaming() {
-		g.P("func ", hname, "(srv interface{}, ctx ", contextPkg, ".Context, dec func(interface{}) error, interceptor ", grpcPkg, ".UnaryServerInterceptor) (interface{}, error) {")
-		g.P("in := new(", inType, ")")
-		g.P("if err := dec(in); err != nil { return nil, err }")
-		g.P("if interceptor == nil { return srv.(", servName, "Server).", methName, "(ctx, in) }")
-		g.P("info := &", grpcPkg, ".UnaryServerInfo{")
-		g.P("Server: srv,")
-		g.P("FullMethod: ", strconv.Quote(fmt.Sprintf("/%s/%s", fullServName, methName)), ",")
-		g.P("}")
-		g.P("handler := func(ctx ", contextPkg, ".Context, req interface{}) (interface{}, error) {")
-		g.P("return srv.(", servName, "Server).", methName, "(ctx, req.(*", inType, "))")
-		g.P("}")
-		g.P("return interceptor(ctx, in, info, handler)")
-		g.P("}")
-		g.P()
-		return hname
-	}
-	streamType := unexport(servName) + methName + "Server"
-	g.P("func ", hname, "(srv interface{}, stream ", grpcPkg, ".ServerStream) error {")
-	if !method.GetClientStreaming() {
-		g.P("m := new(", inType, ")")
-		g.P("if err := stream.RecvMsg(m); err != nil { return err }")
-		g.P("return srv.(", servName, "Server).", methName, "(m, &", streamType, "{stream})")
-	} else {
-		g.P("return srv.(", servName, "Server).", methName, "(&", streamType, "{stream})")
-	}
-	g.P("}")
-	g.P()
-
-	genSend := method.GetServerStreaming()
-	genSendAndClose := !method.GetServerStreaming()
-	genRecv := method.GetClientStreaming()
-
-	// Stream auxiliary types and methods.
-	g.P("type ", servName, "_", methName, "Server interface {")
-	if genSend {
-		g.P("Send(*", outType, ") error")
-	}
-	if genSendAndClose {
-		g.P("SendAndClose(*", outType, ") error")
-	}
-	if genRecv {
-		g.P("Recv() (*", inType, ", error)")
-	}
-	g.P(grpcPkg, ".ServerStream")
-	g.P("}")
-	g.P()
-
-	g.P("type ", streamType, " struct {")
-	g.P(grpcPkg, ".ServerStream")
-	g.P("}")
-	g.P()
-
-	if genSend {
-		g.P("func (x *", streamType, ") Send(m *", outType, ") error {")
-		g.P("return x.ServerStream.SendMsg(m)")
-		g.P("}")
-		g.P()
-	}
-	if genSendAndClose {
-		g.P("func (x *", streamType, ") SendAndClose(m *", outType, ") error {")
-		g.P("return x.ServerStream.SendMsg(m)")
-		g.P("}")
-		g.P()
-	}
-	if genRecv {
-		g.P("func (x *", streamType, ") Recv() (*", inType, ", error) {")
-		g.P("m := new(", inType, ")")
-		g.P("if err := x.ServerStream.RecvMsg(m); err != nil { return nil, err }")
-		g.P("return m, nil")
-		g.P("}")
-		g.P()
-	}
-
-	return hname
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go b/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go
deleted file mode 100644
index 532a550..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/link_grpc.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2015 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-package main
-
-import _ "github.com/golang/protobuf/protoc-gen-go/grpc"
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/main.go b/vendor/github.com/golang/protobuf/protoc-gen-go/main.go
deleted file mode 100644
index 8e2486d..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/main.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Go support for Protocol Buffers - Google's data interchange format
-//
-// Copyright 2010 The Go Authors.  All rights reserved.
-// https://github.com/golang/protobuf
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// protoc-gen-go is a plugin for the Google protocol buffer compiler to generate
-// Go code.  Run it by building this program and putting it in your path with
-// the name
-// 	protoc-gen-go
-// That word 'go' at the end becomes part of the option string set for the
-// protocol compiler, so once the protocol compiler (protoc) is installed
-// you can run
-// 	protoc --go_out=output_directory input_directory/file.proto
-// to generate Go bindings for the protocol defined by file.proto.
-// With that input, the output will be written to
-// 	output_directory/file.pb.go
-//
-// The generated code is documented in the package comment for
-// the library.
-//
-// See the README and documentation for protocol buffers to learn more:
-// 	https://developers.google.com/protocol-buffers/
-package main
-
-import (
-	"io/ioutil"
-	"os"
-
-	"github.com/golang/protobuf/proto"
-	"github.com/golang/protobuf/protoc-gen-go/generator"
-)
-
-func main() {
-	// Begin by allocating a generator. The request and response structures are stored there
-	// so we can do error handling easily - the response structure contains the field to
-	// report failure.
-	g := generator.New()
-
-	data, err := ioutil.ReadAll(os.Stdin)
-	if err != nil {
-		g.Error(err, "reading input")
-	}
-
-	if err := proto.Unmarshal(data, g.Request); err != nil {
-		g.Error(err, "parsing input proto")
-	}
-
-	if len(g.Request.FileToGenerate) == 0 {
-		g.Fail("no files to generate")
-	}
-
-	g.CommandLineParameters(g.Request.GetParameter())
-
-	// Create a wrapped version of the Descriptors and EnumDescriptors that
-	// point to the file that defines them.
-	g.WrapTypes()
-
-	g.SetPackageNames()
-	g.BuildTypeNameMap()
-
-	g.GenerateAllFiles()
-
-	// Send back the results.
-	data, err = proto.Marshal(g.Response)
-	if err != nil {
-		g.Error(err, "failed to marshal output proto")
-	}
-	_, err = os.Stdout.Write(data)
-	if err != nil {
-		g.Error(err, "failed to write output proto")
-	}
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
deleted file mode 100644
index 61bfc10..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.go
+++ /dev/null
@@ -1,369 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: google/protobuf/compiler/plugin.proto
-
-/*
-Package plugin_go is a generated protocol buffer package.
-
-It is generated from these files:
-	google/protobuf/compiler/plugin.proto
-
-It has these top-level messages:
-	Version
-	CodeGeneratorRequest
-	CodeGeneratorResponse
-*/
-package plugin_go
-
-import proto "github.com/golang/protobuf/proto"
-import fmt "fmt"
-import math "math"
-import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-
-// 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
-
-// The version number of protocol compiler.
-type Version struct {
-	Major *int32 `protobuf:"varint,1,opt,name=major" json:"major,omitempty"`
-	Minor *int32 `protobuf:"varint,2,opt,name=minor" json:"minor,omitempty"`
-	Patch *int32 `protobuf:"varint,3,opt,name=patch" json:"patch,omitempty"`
-	// A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
-	// be empty for mainline stable releases.
-	Suffix               *string  `protobuf:"bytes,4,opt,name=suffix" json:"suffix,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *Version) Reset()                    { *m = Version{} }
-func (m *Version) String() string            { return proto.CompactTextString(m) }
-func (*Version) ProtoMessage()               {}
-func (*Version) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
-func (m *Version) Unmarshal(b []byte) error {
-	return xxx_messageInfo_Version.Unmarshal(m, b)
-}
-func (m *Version) Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Version.Marshal(b, m, deterministic)
-}
-func (dst *Version) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Version.Merge(dst, src)
-}
-func (m *Version) XXX_Size() int {
-	return xxx_messageInfo_Version.Size(m)
-}
-func (m *Version) XXX_DiscardUnknown() {
-	xxx_messageInfo_Version.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Version proto.InternalMessageInfo
-
-func (m *Version) GetMajor() int32 {
-	if m != nil && m.Major != nil {
-		return *m.Major
-	}
-	return 0
-}
-
-func (m *Version) GetMinor() int32 {
-	if m != nil && m.Minor != nil {
-		return *m.Minor
-	}
-	return 0
-}
-
-func (m *Version) GetPatch() int32 {
-	if m != nil && m.Patch != nil {
-		return *m.Patch
-	}
-	return 0
-}
-
-func (m *Version) GetSuffix() string {
-	if m != nil && m.Suffix != nil {
-		return *m.Suffix
-	}
-	return ""
-}
-
-// An encoded CodeGeneratorRequest is written to the plugin's stdin.
-type CodeGeneratorRequest struct {
-	// The .proto files that were explicitly listed on the command-line.  The
-	// code generator should generate code only for these files.  Each file's
-	// descriptor will be included in proto_file, below.
-	FileToGenerate []string `protobuf:"bytes,1,rep,name=file_to_generate,json=fileToGenerate" json:"file_to_generate,omitempty"`
-	// The generator parameter passed on the command-line.
-	Parameter *string `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
-	// FileDescriptorProtos for all files in files_to_generate and everything
-	// they import.  The files will appear in topological order, so each file
-	// appears before any file that imports it.
-	//
-	// protoc guarantees that all proto_files will be written after
-	// the fields above, even though this is not technically guaranteed by the
-	// protobuf wire format.  This theoretically could allow a plugin to stream
-	// in the FileDescriptorProtos and handle them one by one rather than read
-	// the entire set into memory at once.  However, as of this writing, this
-	// is not similarly optimized on protoc's end -- it will store all fields in
-	// memory at once before sending them to the plugin.
-	//
-	// Type names of fields and extensions in the FileDescriptorProto are always
-	// fully qualified.
-	ProtoFile []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file,json=protoFile" json:"proto_file,omitempty"`
-	// The version number of protocol compiler.
-	CompilerVersion      *Version `protobuf:"bytes,3,opt,name=compiler_version,json=compilerVersion" json:"compiler_version,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *CodeGeneratorRequest) Reset()                    { *m = CodeGeneratorRequest{} }
-func (m *CodeGeneratorRequest) String() string            { return proto.CompactTextString(m) }
-func (*CodeGeneratorRequest) ProtoMessage()               {}
-func (*CodeGeneratorRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
-func (m *CodeGeneratorRequest) Unmarshal(b []byte) error {
-	return xxx_messageInfo_CodeGeneratorRequest.Unmarshal(m, b)
-}
-func (m *CodeGeneratorRequest) Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_CodeGeneratorRequest.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorRequest) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_CodeGeneratorRequest.Merge(dst, src)
-}
-func (m *CodeGeneratorRequest) XXX_Size() int {
-	return xxx_messageInfo_CodeGeneratorRequest.Size(m)
-}
-func (m *CodeGeneratorRequest) XXX_DiscardUnknown() {
-	xxx_messageInfo_CodeGeneratorRequest.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorRequest proto.InternalMessageInfo
-
-func (m *CodeGeneratorRequest) GetFileToGenerate() []string {
-	if m != nil {
-		return m.FileToGenerate
-	}
-	return nil
-}
-
-func (m *CodeGeneratorRequest) GetParameter() string {
-	if m != nil && m.Parameter != nil {
-		return *m.Parameter
-	}
-	return ""
-}
-
-func (m *CodeGeneratorRequest) GetProtoFile() []*google_protobuf.FileDescriptorProto {
-	if m != nil {
-		return m.ProtoFile
-	}
-	return nil
-}
-
-func (m *CodeGeneratorRequest) GetCompilerVersion() *Version {
-	if m != nil {
-		return m.CompilerVersion
-	}
-	return nil
-}
-
-// The plugin writes an encoded CodeGeneratorResponse to stdout.
-type CodeGeneratorResponse struct {
-	// Error message.  If non-empty, code generation failed.  The plugin process
-	// should exit with status code zero even if it reports an error in this way.
-	//
-	// This should be used to indicate errors in .proto files which prevent the
-	// code generator from generating correct code.  Errors which indicate a
-	// problem in protoc itself -- such as the input CodeGeneratorRequest being
-	// unparseable -- should be reported by writing a message to stderr and
-	// exiting with a non-zero status code.
-	Error                *string                       `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
-	File                 []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
-	XXX_unrecognized     []byte                        `json:"-"`
-	XXX_sizecache        int32                         `json:"-"`
-}
-
-func (m *CodeGeneratorResponse) Reset()                    { *m = CodeGeneratorResponse{} }
-func (m *CodeGeneratorResponse) String() string            { return proto.CompactTextString(m) }
-func (*CodeGeneratorResponse) ProtoMessage()               {}
-func (*CodeGeneratorResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
-func (m *CodeGeneratorResponse) Unmarshal(b []byte) error {
-	return xxx_messageInfo_CodeGeneratorResponse.Unmarshal(m, b)
-}
-func (m *CodeGeneratorResponse) Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_CodeGeneratorResponse.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorResponse) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_CodeGeneratorResponse.Merge(dst, src)
-}
-func (m *CodeGeneratorResponse) XXX_Size() int {
-	return xxx_messageInfo_CodeGeneratorResponse.Size(m)
-}
-func (m *CodeGeneratorResponse) XXX_DiscardUnknown() {
-	xxx_messageInfo_CodeGeneratorResponse.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorResponse proto.InternalMessageInfo
-
-func (m *CodeGeneratorResponse) GetError() string {
-	if m != nil && m.Error != nil {
-		return *m.Error
-	}
-	return ""
-}
-
-func (m *CodeGeneratorResponse) GetFile() []*CodeGeneratorResponse_File {
-	if m != nil {
-		return m.File
-	}
-	return nil
-}
-
-// Represents a single generated file.
-type CodeGeneratorResponse_File struct {
-	// The file name, relative to the output directory.  The name must not
-	// contain "." or ".." components and must be relative, not be absolute (so,
-	// the file cannot lie outside the output directory).  "/" must be used as
-	// the path separator, not "\".
-	//
-	// If the name is omitted, the content will be appended to the previous
-	// file.  This allows the generator to break large files into small chunks,
-	// and allows the generated text to be streamed back to protoc so that large
-	// files need not reside completely in memory at one time.  Note that as of
-	// this writing protoc does not optimize for this -- it will read the entire
-	// CodeGeneratorResponse before writing files to disk.
-	Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
-	// If non-empty, indicates that the named file should already exist, and the
-	// content here is to be inserted into that file at a defined insertion
-	// point.  This feature allows a code generator to extend the output
-	// produced by another code generator.  The original generator may provide
-	// insertion points by placing special annotations in the file that look
-	// like:
-	//   @@protoc_insertion_point(NAME)
-	// The annotation can have arbitrary text before and after it on the line,
-	// which allows it to be placed in a comment.  NAME should be replaced with
-	// an identifier naming the point -- this is what other generators will use
-	// as the insertion_point.  Code inserted at this point will be placed
-	// immediately above the line containing the insertion point (thus multiple
-	// insertions to the same point will come out in the order they were added).
-	// The double-@ is intended to make it unlikely that the generated code
-	// could contain things that look like insertion points by accident.
-	//
-	// For example, the C++ code generator places the following line in the
-	// .pb.h files that it generates:
-	//   // @@protoc_insertion_point(namespace_scope)
-	// This line appears within the scope of the file's package namespace, but
-	// outside of any particular class.  Another plugin can then specify the
-	// insertion_point "namespace_scope" to generate additional classes or
-	// other declarations that should be placed in this scope.
-	//
-	// Note that if the line containing the insertion point begins with
-	// whitespace, the same whitespace will be added to every line of the
-	// inserted text.  This is useful for languages like Python, where
-	// indentation matters.  In these languages, the insertion point comment
-	// should be indented the same amount as any inserted code will need to be
-	// in order to work correctly in that context.
-	//
-	// The code generator that generates the initial file and the one which
-	// inserts into it must both run as part of a single invocation of protoc.
-	// Code generators are executed in the order in which they appear on the
-	// command line.
-	//
-	// If |insertion_point| is present, |name| must also be present.
-	InsertionPoint *string `protobuf:"bytes,2,opt,name=insertion_point,json=insertionPoint" json:"insertion_point,omitempty"`
-	// The file contents.
-	Content              *string  `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *CodeGeneratorResponse_File) Reset()                    { *m = CodeGeneratorResponse_File{} }
-func (m *CodeGeneratorResponse_File) String() string            { return proto.CompactTextString(m) }
-func (*CodeGeneratorResponse_File) ProtoMessage()               {}
-func (*CodeGeneratorResponse_File) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2, 0} }
-func (m *CodeGeneratorResponse_File) Unmarshal(b []byte) error {
-	return xxx_messageInfo_CodeGeneratorResponse_File.Unmarshal(m, b)
-}
-func (m *CodeGeneratorResponse_File) Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_CodeGeneratorResponse_File.Marshal(b, m, deterministic)
-}
-func (dst *CodeGeneratorResponse_File) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_CodeGeneratorResponse_File.Merge(dst, src)
-}
-func (m *CodeGeneratorResponse_File) XXX_Size() int {
-	return xxx_messageInfo_CodeGeneratorResponse_File.Size(m)
-}
-func (m *CodeGeneratorResponse_File) XXX_DiscardUnknown() {
-	xxx_messageInfo_CodeGeneratorResponse_File.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_CodeGeneratorResponse_File proto.InternalMessageInfo
-
-func (m *CodeGeneratorResponse_File) GetName() string {
-	if m != nil && m.Name != nil {
-		return *m.Name
-	}
-	return ""
-}
-
-func (m *CodeGeneratorResponse_File) GetInsertionPoint() string {
-	if m != nil && m.InsertionPoint != nil {
-		return *m.InsertionPoint
-	}
-	return ""
-}
-
-func (m *CodeGeneratorResponse_File) GetContent() string {
-	if m != nil && m.Content != nil {
-		return *m.Content
-	}
-	return ""
-}
-
-func init() {
-	proto.RegisterType((*Version)(nil), "google.protobuf.compiler.Version")
-	proto.RegisterType((*CodeGeneratorRequest)(nil), "google.protobuf.compiler.CodeGeneratorRequest")
-	proto.RegisterType((*CodeGeneratorResponse)(nil), "google.protobuf.compiler.CodeGeneratorResponse")
-	proto.RegisterType((*CodeGeneratorResponse_File)(nil), "google.protobuf.compiler.CodeGeneratorResponse.File")
-}
-
-func init() { proto.RegisterFile("google/protobuf/compiler/plugin.proto", fileDescriptor0) }
-
-var fileDescriptor0 = []byte{
-	// 417 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0xcf, 0x6a, 0x14, 0x41,
-	0x10, 0xc6, 0x19, 0x77, 0x63, 0x98, 0x8a, 0x64, 0x43, 0x13, 0xa5, 0x09, 0x39, 0x8c, 0x8b, 0xe2,
-	0x5c, 0x32, 0x0b, 0xc1, 0x8b, 0x78, 0x4b, 0x44, 0x3d, 0x78, 0x58, 0x1a, 0xf1, 0x20, 0xc8, 0x30,
-	0x99, 0xd4, 0x74, 0x5a, 0x66, 0xba, 0xc6, 0xee, 0x1e, 0xf1, 0x49, 0x7d, 0x0f, 0xdf, 0x40, 0xfa,
-	0xcf, 0x24, 0xb2, 0xb8, 0xa7, 0xee, 0xef, 0x57, 0xd5, 0xd5, 0x55, 0x1f, 0x05, 0x2f, 0x25, 0x91,
-	0xec, 0x71, 0x33, 0x1a, 0x72, 0x74, 0x33, 0x75, 0x9b, 0x96, 0x86, 0x51, 0xf5, 0x68, 0x36, 0x63,
-	0x3f, 0x49, 0xa5, 0xab, 0x10, 0x60, 0x3c, 0xa6, 0x55, 0x73, 0x5a, 0x35, 0xa7, 0x9d, 0x15, 0xbb,
-	0x05, 0x6e, 0xd1, 0xb6, 0x46, 0x8d, 0x8e, 0x4c, 0xcc, 0x5e, 0xb7, 0x70, 0xf8, 0x05, 0x8d, 0x55,
-	0xa4, 0xd9, 0x29, 0x1c, 0x0c, 0xcd, 0x77, 0x32, 0x3c, 0x2b, 0xb2, 0xf2, 0x40, 0x44, 0x11, 0xa8,
-	0xd2, 0x64, 0xf8, 0xa3, 0x44, 0xbd, 0xf0, 0x74, 0x6c, 0x5c, 0x7b, 0xc7, 0x17, 0x91, 0x06, 0xc1,
-	0x9e, 0xc1, 0x63, 0x3b, 0x75, 0x9d, 0xfa, 0xc5, 0x97, 0x45, 0x56, 0xe6, 0x22, 0xa9, 0xf5, 0x9f,
-	0x0c, 0x4e, 0xaf, 0xe9, 0x16, 0x3f, 0xa0, 0x46, 0xd3, 0x38, 0x32, 0x02, 0x7f, 0x4c, 0x68, 0x1d,
-	0x2b, 0xe1, 0xa4, 0x53, 0x3d, 0xd6, 0x8e, 0x6a, 0x19, 0x63, 0xc8, 0xb3, 0x62, 0x51, 0xe6, 0xe2,
-	0xd8, 0xf3, 0xcf, 0x94, 0x5e, 0x20, 0x3b, 0x87, 0x7c, 0x6c, 0x4c, 0x33, 0xa0, 0xc3, 0xd8, 0x4a,
-	0x2e, 0x1e, 0x00, 0xbb, 0x06, 0x08, 0xe3, 0xd4, 0xfe, 0x15, 0x5f, 0x15, 0x8b, 0xf2, 0xe8, 0xf2,
-	0x45, 0xb5, 0x6b, 0xcb, 0x7b, 0xd5, 0xe3, 0xbb, 0x7b, 0x03, 0xb6, 0x1e, 0x8b, 0x3c, 0x44, 0x7d,
-	0x84, 0x7d, 0x82, 0x93, 0xd9, 0xb8, 0xfa, 0x67, 0xf4, 0x24, 0x8c, 0x77, 0x74, 0xf9, 0xbc, 0xda,
-	0xe7, 0x70, 0x95, 0xcc, 0x13, 0xab, 0x99, 0x24, 0xb0, 0xfe, 0x9d, 0xc1, 0xd3, 0x9d, 0x99, 0xed,
-	0x48, 0xda, 0xa2, 0xf7, 0x0e, 0x8d, 0x49, 0x3e, 0xe7, 0x22, 0x0a, 0xf6, 0x11, 0x96, 0xff, 0x34,
-	0xff, 0x7a, 0xff, 0x8f, 0xff, 0x2d, 0x1a, 0x66, 0x13, 0xa1, 0xc2, 0xd9, 0x37, 0x58, 0x86, 0x79,
-	0x18, 0x2c, 0x75, 0x33, 0x60, 0xfa, 0x26, 0xdc, 0xd9, 0x2b, 0x58, 0x29, 0x6d, 0xd1, 0x38, 0x45,
-	0xba, 0x1e, 0x49, 0x69, 0x97, 0xcc, 0x3c, 0xbe, 0xc7, 0x5b, 0x4f, 0x19, 0x87, 0xc3, 0x96, 0xb4,
-	0x43, 0xed, 0xf8, 0x2a, 0x24, 0xcc, 0xf2, 0x4a, 0xc2, 0x79, 0x4b, 0xc3, 0xde, 0xfe, 0xae, 0x9e,
-	0x6c, 0xc3, 0x6e, 0x06, 0x7b, 0xed, 0xd7, 0x37, 0x52, 0xb9, 0xbb, 0xe9, 0xc6, 0x87, 0x37, 0x92,
-	0xfa, 0x46, 0xcb, 0x87, 0x65, 0x0c, 0x97, 0xf6, 0x42, 0xa2, 0xbe, 0x90, 0x94, 0x56, 0xfa, 0x6d,
-	0x3c, 0x6a, 0x49, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x15, 0x40, 0xc5, 0xfe, 0x02, 0x00,
-	0x00,
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden
deleted file mode 100644
index 8953d0f..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.pb.golden
+++ /dev/null
@@ -1,83 +0,0 @@
-// Code generated by protoc-gen-go.
-// source: google/protobuf/compiler/plugin.proto
-// DO NOT EDIT!
-
-package google_protobuf_compiler
-
-import proto "github.com/golang/protobuf/proto"
-import "math"
-import google_protobuf "github.com/golang/protobuf/protoc-gen-go/descriptor"
-
-// Reference proto and math imports to suppress error if they are not otherwise used.
-var _ = proto.GetString
-var _ = math.Inf
-
-type CodeGeneratorRequest struct {
-	FileToGenerate   []string                               `protobuf:"bytes,1,rep,name=file_to_generate" json:"file_to_generate,omitempty"`
-	Parameter        *string                                `protobuf:"bytes,2,opt,name=parameter" json:"parameter,omitempty"`
-	ProtoFile        []*google_protobuf.FileDescriptorProto `protobuf:"bytes,15,rep,name=proto_file" json:"proto_file,omitempty"`
-	XXX_unrecognized []byte                                 `json:"-"`
-}
-
-func (this *CodeGeneratorRequest) Reset()         { *this = CodeGeneratorRequest{} }
-func (this *CodeGeneratorRequest) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorRequest) ProtoMessage()       {}
-
-func (this *CodeGeneratorRequest) GetParameter() string {
-	if this != nil && this.Parameter != nil {
-		return *this.Parameter
-	}
-	return ""
-}
-
-type CodeGeneratorResponse struct {
-	Error            *string                       `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
-	File             []*CodeGeneratorResponse_File `protobuf:"bytes,15,rep,name=file" json:"file,omitempty"`
-	XXX_unrecognized []byte                        `json:"-"`
-}
-
-func (this *CodeGeneratorResponse) Reset()         { *this = CodeGeneratorResponse{} }
-func (this *CodeGeneratorResponse) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorResponse) ProtoMessage()       {}
-
-func (this *CodeGeneratorResponse) GetError() string {
-	if this != nil && this.Error != nil {
-		return *this.Error
-	}
-	return ""
-}
-
-type CodeGeneratorResponse_File struct {
-	Name             *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
-	InsertionPoint   *string `protobuf:"bytes,2,opt,name=insertion_point" json:"insertion_point,omitempty"`
-	Content          *string `protobuf:"bytes,15,opt,name=content" json:"content,omitempty"`
-	XXX_unrecognized []byte  `json:"-"`
-}
-
-func (this *CodeGeneratorResponse_File) Reset()         { *this = CodeGeneratorResponse_File{} }
-func (this *CodeGeneratorResponse_File) String() string { return proto.CompactTextString(this) }
-func (*CodeGeneratorResponse_File) ProtoMessage()       {}
-
-func (this *CodeGeneratorResponse_File) GetName() string {
-	if this != nil && this.Name != nil {
-		return *this.Name
-	}
-	return ""
-}
-
-func (this *CodeGeneratorResponse_File) GetInsertionPoint() string {
-	if this != nil && this.InsertionPoint != nil {
-		return *this.InsertionPoint
-	}
-	return ""
-}
-
-func (this *CodeGeneratorResponse_File) GetContent() string {
-	if this != nil && this.Content != nil {
-		return *this.Content
-	}
-	return ""
-}
-
-func init() {
-}
diff --git a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto b/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto
deleted file mode 100644
index 5b55745..0000000
--- a/vendor/github.com/golang/protobuf/protoc-gen-go/plugin/plugin.proto
+++ /dev/null
@@ -1,167 +0,0 @@
-// Protocol Buffers - Google's data interchange format
-// Copyright 2008 Google Inc.  All rights reserved.
-// https://developers.google.com/protocol-buffers/
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: kenton@google.com (Kenton Varda)
-//
-// WARNING:  The plugin interface is currently EXPERIMENTAL and is subject to
-//   change.
-//
-// protoc (aka the Protocol Compiler) can be extended via plugins.  A plugin is
-// just a program that reads a CodeGeneratorRequest from stdin and writes a
-// CodeGeneratorResponse to stdout.
-//
-// Plugins written using C++ can use google/protobuf/compiler/plugin.h instead
-// of dealing with the raw protocol defined here.
-//
-// A plugin executable needs only to be placed somewhere in the path.  The
-// plugin should be named "protoc-gen-$NAME", and will then be used when the
-// flag "--${NAME}_out" is passed to protoc.
-
-syntax = "proto2";
-package google.protobuf.compiler;
-option java_package = "com.google.protobuf.compiler";
-option java_outer_classname = "PluginProtos";
-
-option go_package = "github.com/golang/protobuf/protoc-gen-go/plugin;plugin_go";
-
-import "google/protobuf/descriptor.proto";
-
-// The version number of protocol compiler.
-message Version {
-  optional int32 major = 1;
-  optional int32 minor = 2;
-  optional int32 patch = 3;
-  // A suffix for alpha, beta or rc release, e.g., "alpha-1", "rc2". It should
-  // be empty for mainline stable releases.
-  optional string suffix = 4;
-}
-
-// An encoded CodeGeneratorRequest is written to the plugin's stdin.
-message CodeGeneratorRequest {
-  // The .proto files that were explicitly listed on the command-line.  The
-  // code generator should generate code only for these files.  Each file's
-  // descriptor will be included in proto_file, below.
-  repeated string file_to_generate = 1;
-
-  // The generator parameter passed on the command-line.
-  optional string parameter = 2;
-
-  // FileDescriptorProtos for all files in files_to_generate and everything
-  // they import.  The files will appear in topological order, so each file
-  // appears before any file that imports it.
-  //
-  // protoc guarantees that all proto_files will be written after
-  // the fields above, even though this is not technically guaranteed by the
-  // protobuf wire format.  This theoretically could allow a plugin to stream
-  // in the FileDescriptorProtos and handle them one by one rather than read
-  // the entire set into memory at once.  However, as of this writing, this
-  // is not similarly optimized on protoc's end -- it will store all fields in
-  // memory at once before sending them to the plugin.
-  //
-  // Type names of fields and extensions in the FileDescriptorProto are always
-  // fully qualified.
-  repeated FileDescriptorProto proto_file = 15;
-
-  // The version number of protocol compiler.
-  optional Version compiler_version = 3;
-
-}
-
-// The plugin writes an encoded CodeGeneratorResponse to stdout.
-message CodeGeneratorResponse {
-  // Error message.  If non-empty, code generation failed.  The plugin process
-  // should exit with status code zero even if it reports an error in this way.
-  //
-  // This should be used to indicate errors in .proto files which prevent the
-  // code generator from generating correct code.  Errors which indicate a
-  // problem in protoc itself -- such as the input CodeGeneratorRequest being
-  // unparseable -- should be reported by writing a message to stderr and
-  // exiting with a non-zero status code.
-  optional string error = 1;
-
-  // Represents a single generated file.
-  message File {
-    // The file name, relative to the output directory.  The name must not
-    // contain "." or ".." components and must be relative, not be absolute (so,
-    // the file cannot lie outside the output directory).  "/" must be used as
-    // the path separator, not "\".
-    //
-    // If the name is omitted, the content will be appended to the previous
-    // file.  This allows the generator to break large files into small chunks,
-    // and allows the generated text to be streamed back to protoc so that large
-    // files need not reside completely in memory at one time.  Note that as of
-    // this writing protoc does not optimize for this -- it will read the entire
-    // CodeGeneratorResponse before writing files to disk.
-    optional string name = 1;
-
-    // If non-empty, indicates that the named file should already exist, and the
-    // content here is to be inserted into that file at a defined insertion
-    // point.  This feature allows a code generator to extend the output
-    // produced by another code generator.  The original generator may provide
-    // insertion points by placing special annotations in the file that look
-    // like:
-    //   @@protoc_insertion_point(NAME)
-    // The annotation can have arbitrary text before and after it on the line,
-    // which allows it to be placed in a comment.  NAME should be replaced with
-    // an identifier naming the point -- this is what other generators will use
-    // as the insertion_point.  Code inserted at this point will be placed
-    // immediately above the line containing the insertion point (thus multiple
-    // insertions to the same point will come out in the order they were added).
-    // The double-@ is intended to make it unlikely that the generated code
-    // could contain things that look like insertion points by accident.
-    //
-    // For example, the C++ code generator places the following line in the
-    // .pb.h files that it generates:
-    //   // @@protoc_insertion_point(namespace_scope)
-    // This line appears within the scope of the file's package namespace, but
-    // outside of any particular class.  Another plugin can then specify the
-    // insertion_point "namespace_scope" to generate additional classes or
-    // other declarations that should be placed in this scope.
-    //
-    // Note that if the line containing the insertion point begins with
-    // whitespace, the same whitespace will be added to every line of the
-    // inserted text.  This is useful for languages like Python, where
-    // indentation matters.  In these languages, the insertion point comment
-    // should be indented the same amount as any inserted code will need to be
-    // in order to work correctly in that context.
-    //
-    // The code generator that generates the initial file and the one which
-    // inserts into it must both run as part of a single invocation of protoc.
-    // Code generators are executed in the order in which they appear on the
-    // command line.
-    //
-    // If |insertion_point| is present, |name| must also be present.
-    optional string insertion_point = 2;
-
-    // The file contents.
-    optional string content = 15;
-  }
-  repeated File file = 15;
-}
diff --git a/vendor/github.com/googleapis/gnostic/extensions/COMPILE-EXTENSION.sh b/vendor/github.com/googleapis/gnostic/extensions/COMPILE-EXTENSION.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/imdario/mergo/testdata/license.yml b/vendor/github.com/imdario/mergo/testdata/license.yml
deleted file mode 100644
index 2f1ad00..0000000
--- a/vendor/github.com/imdario/mergo/testdata/license.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-import: ../../../../fossene/db/schema/thing.yml
-fields:
-    site: string
-    author: root
diff --git a/vendor/github.com/json-iterator/go/build.sh b/vendor/github.com/json-iterator/go/build.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/json-iterator/go/test.sh b/vendor/github.com/json-iterator/go/test.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/modern-go/concurrent/test.sh b/vendor/github.com/modern-go/concurrent/test.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/modern-go/reflect2/test.sh b/vendor/github.com/modern-go/reflect2/test.sh
old mode 100755
new mode 100644
diff --git a/vendor/github.com/opencord/voltha-go/kafka/client.go b/vendor/github.com/opencord/voltha-go/kafka/client.go
old mode 100755
new mode 100644
diff --git a/vendor/github.com/opencord/voltha-go/kafka/sarama_client.go b/vendor/github.com/opencord/voltha-go/kafka/sarama_client.go
old mode 100755
new mode 100644
diff --git a/vendor/github.com/opencord/voltha-protos/Makefile b/vendor/github.com/opencord/voltha-protos/Makefile
index b9083d5..c34fb7e 100644
--- a/vendor/github.com/opencord/voltha-protos/Makefile
+++ b/vendor/github.com/opencord/voltha-protos/Makefile
@@ -33,7 +33,7 @@
 PROTO_GO_PB:= $(foreach f, $(PROTO_FILES), $(patsubst protos/voltha_protos/%.proto,$(PROTO_GO_DEST_DIR)/$(call go_package_path,$(f))/%.pb.go,$(f)))
 
 # Force pb file to be regenrated every time.  Otherwise the make process assumes generated version is still valid
-.PHONY: go/voltha.pb protoc_check
+.PHONY: voltha.pb protoc_check
 
 print:
 	@echo "Proto files: $(PROTO_FILES)"
@@ -92,7 +92,7 @@
     $(PROTO_PYTHON_PB2_GRPC)
 
 # Go targets
-go-protos: protoc_check $(PROTO_GO_PB) go/voltha.pb
+go-protos: protoc_check $(PROTO_GO_PB) voltha.pb
 
 go_temp:
 	mkdir -p go_temp
@@ -105,7 +105,7 @@
 	mkdir -p $(dir $@)
 	mv go_temp/voltha_protos/$(notdir $@) $@
 
-go/voltha.pb: ${PROTO_FILES}
+voltha.pb: ${PROTO_FILES}
 	@echo "Creating $@"
 	protoc -I protos -I protos/google/api \
     --include_imports --include_source_info \
@@ -114,6 +114,7 @@
 
 go-test: protoc_check
 	test/test-go-proto-consistency.sh
+	GO111MODULE=on go mod verify
 
 go-clean:
 	rm -rf go_temp
diff --git a/vendor/github.com/opencord/voltha-protos/VERSION b/vendor/github.com/opencord/voltha-protos/VERSION
index 7dea76e..21e8796 100644
--- a/vendor/github.com/opencord/voltha-protos/VERSION
+++ b/vendor/github.com/opencord/voltha-protos/VERSION
@@ -1 +1 @@
-1.0.1
+1.0.3
diff --git a/vendor/github.com/opencord/voltha-protos/go.mod b/vendor/github.com/opencord/voltha-protos/go.mod
new file mode 100644
index 0000000..8fb2ecc
--- /dev/null
+++ b/vendor/github.com/opencord/voltha-protos/go.mod
@@ -0,0 +1,10 @@
+module github.com/opencord/voltha-protos
+
+go 1.12
+
+require (
+	github.com/golang/protobuf v1.3.1
+	golang.org/x/net v0.0.0-20190311183353-d8887717615a // indirect
+	google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
+	google.golang.org/grpc v1.17.0
+)
diff --git a/vendor/github.com/opencord/voltha-protos/go.sum b/vendor/github.com/opencord/voltha-protos/go.sum
new file mode 100644
index 0000000..22e9818
--- /dev/null
+++ b/vendor/github.com/opencord/voltha-protos/go.sum
@@ -0,0 +1,28 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/grpc v1.17.0 h1:TRJYBgMclJvGYn2rIMjj+h9KtMt5r1Ij7ODVRIZkwhk=
+google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/vendor/github.com/opencord/voltha-protos/go/ietf/ietf_interfaces.pb.go b/vendor/github.com/opencord/voltha-protos/go/ietf/ietf_interfaces.pb.go
deleted file mode 100644
index e5f1f36..0000000
--- a/vendor/github.com/opencord/voltha-protos/go/ietf/ietf_interfaces.pb.go
+++ /dev/null
@@ -1,431 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: voltha_protos/ietf_interfaces.proto
-
-package ietf
-
-import (
-	fmt "fmt"
-	proto "github.com/golang/protobuf/proto"
-	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 Interface_LinkUpDownTrapEnableType int32
-
-const (
-	Interface_TRAP_DISABLED Interface_LinkUpDownTrapEnableType = 0
-	Interface_TRAP_ENABLED  Interface_LinkUpDownTrapEnableType = 1
-)
-
-var Interface_LinkUpDownTrapEnableType_name = map[int32]string{
-	0: "TRAP_DISABLED",
-	1: "TRAP_ENABLED",
-}
-
-var Interface_LinkUpDownTrapEnableType_value = map[string]int32{
-	"TRAP_DISABLED": 0,
-	"TRAP_ENABLED":  1,
-}
-
-func (x Interface_LinkUpDownTrapEnableType) String() string {
-	return proto.EnumName(Interface_LinkUpDownTrapEnableType_name, int32(x))
-}
-
-func (Interface_LinkUpDownTrapEnableType) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{1, 0}
-}
-
-type InterfaceState_AdminStatusType int32
-
-const (
-	InterfaceState_ADMIN_DOWN    InterfaceState_AdminStatusType = 0
-	InterfaceState_ADMIN_TESTING InterfaceState_AdminStatusType = 1
-	InterfaceState_ADMIN_UP      InterfaceState_AdminStatusType = 2
-)
-
-var InterfaceState_AdminStatusType_name = map[int32]string{
-	0: "ADMIN_DOWN",
-	1: "ADMIN_TESTING",
-	2: "ADMIN_UP",
-}
-
-var InterfaceState_AdminStatusType_value = map[string]int32{
-	"ADMIN_DOWN":    0,
-	"ADMIN_TESTING": 1,
-	"ADMIN_UP":      2,
-}
-
-func (x InterfaceState_AdminStatusType) String() string {
-	return proto.EnumName(InterfaceState_AdminStatusType_name, int32(x))
-}
-
-func (InterfaceState_AdminStatusType) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{3, 0}
-}
-
-type InterfaceState_OperStatusType int32
-
-const (
-	InterfaceState_DORMANT          InterfaceState_OperStatusType = 0
-	InterfaceState_LOWER_LAYER_DOWN InterfaceState_OperStatusType = 1
-	InterfaceState_UNKNOWN          InterfaceState_OperStatusType = 2
-	InterfaceState_TESTING          InterfaceState_OperStatusType = 3
-	InterfaceState_UP               InterfaceState_OperStatusType = 4
-	InterfaceState_DOWN             InterfaceState_OperStatusType = 5
-	InterfaceState_NOT_PRESENT      InterfaceState_OperStatusType = 6
-)
-
-var InterfaceState_OperStatusType_name = map[int32]string{
-	0: "DORMANT",
-	1: "LOWER_LAYER_DOWN",
-	2: "UNKNOWN",
-	3: "TESTING",
-	4: "UP",
-	5: "DOWN",
-	6: "NOT_PRESENT",
-}
-
-var InterfaceState_OperStatusType_value = map[string]int32{
-	"DORMANT":          0,
-	"LOWER_LAYER_DOWN": 1,
-	"UNKNOWN":          2,
-	"TESTING":          3,
-	"UP":               4,
-	"DOWN":             5,
-	"NOT_PRESENT":      6,
-}
-
-func (x InterfaceState_OperStatusType) String() string {
-	return proto.EnumName(InterfaceState_OperStatusType_name, int32(x))
-}
-
-func (InterfaceState_OperStatusType) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{3, 1}
-}
-
-type Interfaces struct {
-	AllInterfaces        []*Interface `protobuf:"bytes,1,rep,name=all_interfaces,json=allInterfaces,proto3" json:"all_interfaces,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
-	XXX_unrecognized     []byte       `json:"-"`
-	XXX_sizecache        int32        `json:"-"`
-}
-
-func (m *Interfaces) Reset()         { *m = Interfaces{} }
-func (m *Interfaces) String() string { return proto.CompactTextString(m) }
-func (*Interfaces) ProtoMessage()    {}
-func (*Interfaces) Descriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{0}
-}
-
-func (m *Interfaces) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Interfaces.Unmarshal(m, b)
-}
-func (m *Interfaces) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Interfaces.Marshal(b, m, deterministic)
-}
-func (m *Interfaces) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Interfaces.Merge(m, src)
-}
-func (m *Interfaces) XXX_Size() int {
-	return xxx_messageInfo_Interfaces.Size(m)
-}
-func (m *Interfaces) XXX_DiscardUnknown() {
-	xxx_messageInfo_Interfaces.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Interfaces proto.InternalMessageInfo
-
-func (m *Interfaces) GetAllInterfaces() []*Interface {
-	if m != nil {
-		return m.AllInterfaces
-	}
-	return nil
-}
-
-type Interface struct {
-	Name                 string                             `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
-	Description          string                             `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
-	Type                 string                             `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"`
-	Enabled              bool                               `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
-	LinkUpDownTrapEnable Interface_LinkUpDownTrapEnableType `protobuf:"varint,5,opt,name=link_up_down_trap_enable,json=linkUpDownTrapEnable,proto3,enum=ietf.Interface_LinkUpDownTrapEnableType" json:"link_up_down_trap_enable,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_5a91e49a45099096, []int{1}
-}
-
-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 (m *Interface) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Interface.Merge(m, 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) GetName() string {
-	if m != nil {
-		return m.Name
-	}
-	return ""
-}
-
-func (m *Interface) GetDescription() string {
-	if m != nil {
-		return m.Description
-	}
-	return ""
-}
-
-func (m *Interface) GetType() string {
-	if m != nil {
-		return m.Type
-	}
-	return ""
-}
-
-func (m *Interface) GetEnabled() bool {
-	if m != nil {
-		return m.Enabled
-	}
-	return false
-}
-
-func (m *Interface) GetLinkUpDownTrapEnable() Interface_LinkUpDownTrapEnableType {
-	if m != nil {
-		return m.LinkUpDownTrapEnable
-	}
-	return Interface_TRAP_DISABLED
-}
-
-type InterfacesState struct {
-	AllInterfacs         []*InterfaceState `protobuf:"bytes,1,rep,name=all_interfacs,json=allInterfacs,proto3" json:"all_interfacs,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}          `json:"-"`
-	XXX_unrecognized     []byte            `json:"-"`
-	XXX_sizecache        int32             `json:"-"`
-}
-
-func (m *InterfacesState) Reset()         { *m = InterfacesState{} }
-func (m *InterfacesState) String() string { return proto.CompactTextString(m) }
-func (*InterfacesState) ProtoMessage()    {}
-func (*InterfacesState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{2}
-}
-
-func (m *InterfacesState) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_InterfacesState.Unmarshal(m, b)
-}
-func (m *InterfacesState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_InterfacesState.Marshal(b, m, deterministic)
-}
-func (m *InterfacesState) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_InterfacesState.Merge(m, src)
-}
-func (m *InterfacesState) XXX_Size() int {
-	return xxx_messageInfo_InterfacesState.Size(m)
-}
-func (m *InterfacesState) XXX_DiscardUnknown() {
-	xxx_messageInfo_InterfacesState.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_InterfacesState proto.InternalMessageInfo
-
-func (m *InterfacesState) GetAllInterfacs() []*InterfaceState {
-	if m != nil {
-		return m.AllInterfacs
-	}
-	return nil
-}
-
-type InterfaceState struct {
-	Name                 string                         `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
-	Type                 string                         `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"`
-	AdminStatus          InterfaceState_AdminStatusType `protobuf:"varint,3,opt,name=admin_status,json=adminStatus,proto3,enum=ietf.InterfaceState_AdminStatusType" json:"admin_status,omitempty"`
-	OperStatus           InterfaceState_OperStatusType  `protobuf:"varint,4,opt,name=oper_status,json=operStatus,proto3,enum=ietf.InterfaceState_OperStatusType" json:"oper_status,omitempty"`
-	LastChange           string                         `protobuf:"bytes,5,opt,name=last_change,json=lastChange,proto3" json:"last_change,omitempty"`
-	IfIndex              int32                          `protobuf:"varint,6,opt,name=if_index,json=ifIndex,proto3" json:"if_index,omitempty"`
-	PhysAddress          string                         `protobuf:"bytes,7,opt,name=phys_address,json=physAddress,proto3" json:"phys_address,omitempty"`
-	HigherLayerIf        []string                       `protobuf:"bytes,8,rep,name=higher_layer_if,json=higherLayerIf,proto3" json:"higher_layer_if,omitempty"`
-	LowerLayerIf         []string                       `protobuf:"bytes,9,rep,name=lower_layer_if,json=lowerLayerIf,proto3" json:"lower_layer_if,omitempty"`
-	Speed                uint64                         `protobuf:"varint,10,opt,name=speed,proto3" json:"speed,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                       `json:"-"`
-	XXX_unrecognized     []byte                         `json:"-"`
-	XXX_sizecache        int32                          `json:"-"`
-}
-
-func (m *InterfaceState) Reset()         { *m = InterfaceState{} }
-func (m *InterfaceState) String() string { return proto.CompactTextString(m) }
-func (*InterfaceState) ProtoMessage()    {}
-func (*InterfaceState) Descriptor() ([]byte, []int) {
-	return fileDescriptor_5a91e49a45099096, []int{3}
-}
-
-func (m *InterfaceState) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_InterfaceState.Unmarshal(m, b)
-}
-func (m *InterfaceState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_InterfaceState.Marshal(b, m, deterministic)
-}
-func (m *InterfaceState) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_InterfaceState.Merge(m, src)
-}
-func (m *InterfaceState) XXX_Size() int {
-	return xxx_messageInfo_InterfaceState.Size(m)
-}
-func (m *InterfaceState) XXX_DiscardUnknown() {
-	xxx_messageInfo_InterfaceState.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_InterfaceState proto.InternalMessageInfo
-
-func (m *InterfaceState) GetName() string {
-	if m != nil {
-		return m.Name
-	}
-	return ""
-}
-
-func (m *InterfaceState) GetType() string {
-	if m != nil {
-		return m.Type
-	}
-	return ""
-}
-
-func (m *InterfaceState) GetAdminStatus() InterfaceState_AdminStatusType {
-	if m != nil {
-		return m.AdminStatus
-	}
-	return InterfaceState_ADMIN_DOWN
-}
-
-func (m *InterfaceState) GetOperStatus() InterfaceState_OperStatusType {
-	if m != nil {
-		return m.OperStatus
-	}
-	return InterfaceState_DORMANT
-}
-
-func (m *InterfaceState) GetLastChange() string {
-	if m != nil {
-		return m.LastChange
-	}
-	return ""
-}
-
-func (m *InterfaceState) GetIfIndex() int32 {
-	if m != nil {
-		return m.IfIndex
-	}
-	return 0
-}
-
-func (m *InterfaceState) GetPhysAddress() string {
-	if m != nil {
-		return m.PhysAddress
-	}
-	return ""
-}
-
-func (m *InterfaceState) GetHigherLayerIf() []string {
-	if m != nil {
-		return m.HigherLayerIf
-	}
-	return nil
-}
-
-func (m *InterfaceState) GetLowerLayerIf() []string {
-	if m != nil {
-		return m.LowerLayerIf
-	}
-	return nil
-}
-
-func (m *InterfaceState) GetSpeed() uint64 {
-	if m != nil {
-		return m.Speed
-	}
-	return 0
-}
-
-func init() {
-	proto.RegisterEnum("ietf.Interface_LinkUpDownTrapEnableType", Interface_LinkUpDownTrapEnableType_name, Interface_LinkUpDownTrapEnableType_value)
-	proto.RegisterEnum("ietf.InterfaceState_AdminStatusType", InterfaceState_AdminStatusType_name, InterfaceState_AdminStatusType_value)
-	proto.RegisterEnum("ietf.InterfaceState_OperStatusType", InterfaceState_OperStatusType_name, InterfaceState_OperStatusType_value)
-	proto.RegisterType((*Interfaces)(nil), "ietf.Interfaces")
-	proto.RegisterType((*Interface)(nil), "ietf.Interface")
-	proto.RegisterType((*InterfacesState)(nil), "ietf.InterfacesState")
-	proto.RegisterType((*InterfaceState)(nil), "ietf.InterfaceState")
-}
-
-func init() {
-	proto.RegisterFile("voltha_protos/ietf_interfaces.proto", fileDescriptor_5a91e49a45099096)
-}
-
-var fileDescriptor_5a91e49a45099096 = []byte{
-	// 618 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xcf, 0x6e, 0x9b, 0x4a,
-	0x14, 0xc6, 0x83, 0x8d, 0xff, 0x1d, 0x6c, 0xcc, 0x1d, 0x79, 0xc1, 0x5d, 0x5d, 0x2e, 0x89, 0x2a,
-	0xaa, 0xaa, 0x8e, 0x94, 0x4a, 0x95, 0xba, 0xaa, 0x48, 0x41, 0x91, 0x55, 0x07, 0x5b, 0x63, 0xac,
-	0xa8, 0xdd, 0x4c, 0x27, 0x66, 0x6c, 0xa3, 0x10, 0x18, 0x01, 0x69, 0xea, 0xd7, 0xe8, 0x13, 0xf5,
-	0xd1, 0xaa, 0x19, 0x6a, 0x87, 0x44, 0xee, 0x6e, 0xbe, 0xdf, 0xf9, 0xce, 0x61, 0xf4, 0x31, 0x3a,
-	0x70, 0xfa, 0x3d, 0x4b, 0xca, 0x2d, 0x25, 0x3c, 0xcf, 0xca, 0xac, 0x38, 0x8f, 0x59, 0xb9, 0x26,
-	0x71, 0x5a, 0xb2, 0x7c, 0x4d, 0x57, 0xac, 0x18, 0x4b, 0x8c, 0x54, 0x81, 0x6d, 0x0f, 0x60, 0x72,
-	0xa8, 0xa0, 0xf7, 0xa0, 0xd3, 0x24, 0xa9, 0x79, 0x4d, 0xc5, 0x6a, 0x3a, 0xda, 0xc5, 0x70, 0x2c,
-	0xcc, 0xe3, 0x83, 0x13, 0x0f, 0x68, 0x92, 0x3c, 0xf5, 0xd9, 0x3f, 0x1b, 0xd0, 0x3b, 0x48, 0x84,
-	0x40, 0x4d, 0xe9, 0x3d, 0x33, 0x15, 0x4b, 0x71, 0x7a, 0x58, 0x9e, 0x91, 0x05, 0x5a, 0xc4, 0x8a,
-	0x55, 0x1e, 0xf3, 0x32, 0xce, 0x52, 0xb3, 0x21, 0x4b, 0x75, 0x24, 0xba, 0xca, 0x1d, 0x67, 0x66,
-	0xb3, 0xea, 0x12, 0x67, 0x64, 0x42, 0x87, 0xa5, 0xf4, 0x36, 0x61, 0x91, 0xa9, 0x5a, 0x8a, 0xd3,
-	0xc5, 0x7b, 0x89, 0xbe, 0x81, 0x99, 0xc4, 0xe9, 0x1d, 0x79, 0xe0, 0x24, 0xca, 0x1e, 0x53, 0x52,
-	0xe6, 0x94, 0x93, 0xaa, 0x68, 0xb6, 0x2c, 0xc5, 0xd1, 0x2f, 0x9c, 0x17, 0x77, 0x1e, 0x4f, 0xe3,
-	0xf4, 0x6e, 0xc9, 0xbd, 0xec, 0x31, 0x0d, 0x73, 0xca, 0x7d, 0xe9, 0x0d, 0x77, 0x9c, 0xe1, 0x51,
-	0x72, 0xa4, 0x62, 0x7f, 0x04, 0xf3, 0x6f, 0x1d, 0xe8, 0x1f, 0x18, 0x84, 0xd8, 0x9d, 0x13, 0x6f,
-	0xb2, 0x70, 0x2f, 0xa7, 0xbe, 0x67, 0x9c, 0x20, 0x03, 0xfa, 0x12, 0xf9, 0x41, 0x45, 0x14, 0x7b,
-	0x0a, 0xc3, 0xa7, 0x88, 0x16, 0x25, 0x2d, 0x19, 0xfa, 0x00, 0x83, 0x7a, 0xbe, 0xfb, 0x78, 0x47,
-	0x2f, 0xae, 0x2a, 0xcd, 0xb8, 0x5f, 0xcb, 0xb8, 0xb0, 0x7f, 0xa9, 0xa0, 0x3f, 0x37, 0x1c, 0xcd,
-	0x79, 0x9f, 0x62, 0xa3, 0x96, 0xe2, 0x15, 0xf4, 0x69, 0x74, 0x1f, 0xa7, 0xa4, 0x28, 0x69, 0xf9,
-	0x50, 0xc8, 0x84, 0xf5, 0x8b, 0xb3, 0x63, 0x1f, 0x1d, 0xbb, 0xc2, 0xb8, 0x90, 0x3e, 0x99, 0x8d,
-	0x46, 0x9f, 0x00, 0xf2, 0x40, 0xcb, 0x38, 0xcb, 0xf7, 0x73, 0x54, 0x39, 0xe7, 0xf4, 0xe8, 0x9c,
-	0x19, 0x67, 0x79, 0x6d, 0x0c, 0x64, 0x07, 0x8d, 0xfe, 0x03, 0x2d, 0xa1, 0x45, 0x49, 0x56, 0x5b,
-	0x9a, 0x6e, 0xaa, 0xbf, 0xd5, 0xc3, 0x20, 0xd0, 0x27, 0x49, 0xd0, 0xbf, 0xd0, 0x8d, 0xc5, 0x83,
-	0x8d, 0xd8, 0x0f, 0xb3, 0x6d, 0x29, 0x4e, 0x0b, 0x77, 0xe2, 0xf5, 0x44, 0x48, 0xf4, 0x3f, 0xf4,
-	0xf9, 0x76, 0x57, 0x10, 0x1a, 0x45, 0x39, 0x2b, 0x0a, 0xb3, 0x53, 0xbd, 0x23, 0xc1, 0xdc, 0x0a,
-	0xa1, 0x57, 0x30, 0xdc, 0xc6, 0x9b, 0x2d, 0xcb, 0x49, 0x42, 0x77, 0x2c, 0x27, 0xf1, 0xda, 0xec,
-	0x5a, 0x4d, 0xa7, 0x87, 0x07, 0x15, 0x9e, 0x0a, 0x3a, 0x59, 0xa3, 0x33, 0xd0, 0x93, 0xec, 0xb1,
-	0x6e, 0xeb, 0x49, 0x5b, 0x5f, 0xd2, 0xbd, 0x6b, 0x04, 0xad, 0x82, 0x33, 0x16, 0x99, 0x60, 0x29,
-	0x8e, 0x8a, 0x2b, 0x61, 0x5f, 0xc2, 0xf0, 0x45, 0x50, 0x48, 0x07, 0x70, 0xbd, 0xeb, 0x49, 0x40,
-	0xbc, 0xd9, 0x4d, 0x60, 0x9c, 0x88, 0x27, 0x52, 0xe9, 0xd0, 0x5f, 0x84, 0x93, 0xe0, 0xca, 0x50,
-	0x50, 0x1f, 0xba, 0x15, 0x5a, 0xce, 0x8d, 0x86, 0xcd, 0x41, 0x7f, 0x1e, 0x12, 0xd2, 0xa0, 0xe3,
-	0xcd, 0xf0, 0xb5, 0x1b, 0x84, 0xc6, 0x09, 0x1a, 0x81, 0x31, 0x9d, 0xdd, 0xf8, 0x98, 0x4c, 0xdd,
-	0x2f, 0x3e, 0xae, 0xa6, 0x2a, 0xc2, 0xb2, 0x0c, 0x3e, 0x07, 0x42, 0x34, 0x84, 0xd8, 0x0f, 0x6f,
-	0xa2, 0x36, 0x34, 0x96, 0x73, 0x43, 0x45, 0x5d, 0x50, 0xa5, 0xb7, 0x85, 0x86, 0xa0, 0x05, 0xb3,
-	0x90, 0xcc, 0xb1, 0xbf, 0xf0, 0x83, 0xd0, 0x68, 0x5f, 0xbe, 0xf9, 0xfa, 0x7a, 0x13, 0x97, 0xdb,
-	0x87, 0xdb, 0xf1, 0x2a, 0xbb, 0x3f, 0xcf, 0x38, 0x4b, 0x57, 0x59, 0x1e, 0x9d, 0x57, 0xcb, 0xe2,
-	0xed, 0x9f, 0x65, 0xb1, 0xc9, 0xe4, 0xbe, 0xb8, 0x6d, 0x4b, 0xfd, 0xee, 0x77, 0x00, 0x00, 0x00,
-	0xff, 0xff, 0x69, 0x37, 0x5b, 0x67, 0x4c, 0x04, 0x00, 0x00,
-}
diff --git a/vendor/github.com/opencord/voltha-protos/go/openolt/openolt.pb.go b/vendor/github.com/opencord/voltha-protos/go/openolt/openolt.pb.go
deleted file mode 100644
index 929032c..0000000
--- a/vendor/github.com/opencord/voltha-protos/go/openolt/openolt.pb.go
+++ /dev/null
@@ -1,3973 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: voltha_protos/openolt.proto
-
-package openolt
-
-import (
-	context "context"
-	fmt "fmt"
-	proto "github.com/golang/protobuf/proto"
-	tech_profile "github.com/opencord/voltha-protos/go/tech_profile"
-	_ "google.golang.org/genproto/googleapis/api/annotations"
-	grpc "google.golang.org/grpc"
-	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
-
-// SchedulerConfig from public import voltha_protos/tech_profile.proto
-type SchedulerConfig = tech_profile.SchedulerConfig
-
-// TrafficShapingInfo from public import voltha_protos/tech_profile.proto
-type TrafficShapingInfo = tech_profile.TrafficShapingInfo
-
-// TrafficScheduler from public import voltha_protos/tech_profile.proto
-type TrafficScheduler = tech_profile.TrafficScheduler
-
-// TrafficSchedulers from public import voltha_protos/tech_profile.proto
-type TrafficSchedulers = tech_profile.TrafficSchedulers
-
-// TailDropDiscardConfig from public import voltha_protos/tech_profile.proto
-type TailDropDiscardConfig = tech_profile.TailDropDiscardConfig
-
-// RedDiscardConfig from public import voltha_protos/tech_profile.proto
-type RedDiscardConfig = tech_profile.RedDiscardConfig
-
-// WRedDiscardConfig from public import voltha_protos/tech_profile.proto
-type WRedDiscardConfig = tech_profile.WRedDiscardConfig
-
-// DiscardConfig from public import voltha_protos/tech_profile.proto
-type DiscardConfig = tech_profile.DiscardConfig
-type DiscardConfig_TailDropDiscardConfig = tech_profile.DiscardConfig_TailDropDiscardConfig
-type DiscardConfig_RedDiscardConfig = tech_profile.DiscardConfig_RedDiscardConfig
-type DiscardConfig_WredDiscardConfig = tech_profile.DiscardConfig_WredDiscardConfig
-
-// TrafficQueue from public import voltha_protos/tech_profile.proto
-type TrafficQueue = tech_profile.TrafficQueue
-
-// TrafficQueues from public import voltha_protos/tech_profile.proto
-type TrafficQueues = tech_profile.TrafficQueues
-
-// Direction from public import voltha_protos/tech_profile.proto
-type Direction = tech_profile.Direction
-
-var Direction_name = tech_profile.Direction_name
-var Direction_value = tech_profile.Direction_value
-
-const Direction_UPSTREAM = Direction(tech_profile.Direction_UPSTREAM)
-const Direction_DOWNSTREAM = Direction(tech_profile.Direction_DOWNSTREAM)
-const Direction_BIDIRECTIONAL = Direction(tech_profile.Direction_BIDIRECTIONAL)
-
-// SchedulingPolicy from public import voltha_protos/tech_profile.proto
-type SchedulingPolicy = tech_profile.SchedulingPolicy
-
-var SchedulingPolicy_name = tech_profile.SchedulingPolicy_name
-var SchedulingPolicy_value = tech_profile.SchedulingPolicy_value
-
-const SchedulingPolicy_WRR = SchedulingPolicy(tech_profile.SchedulingPolicy_WRR)
-const SchedulingPolicy_StrictPriority = SchedulingPolicy(tech_profile.SchedulingPolicy_StrictPriority)
-const SchedulingPolicy_Hybrid = SchedulingPolicy(tech_profile.SchedulingPolicy_Hybrid)
-
-// AdditionalBW from public import voltha_protos/tech_profile.proto
-type AdditionalBW = tech_profile.AdditionalBW
-
-var AdditionalBW_name = tech_profile.AdditionalBW_name
-var AdditionalBW_value = tech_profile.AdditionalBW_value
-
-const AdditionalBW_AdditionalBW_None = AdditionalBW(tech_profile.AdditionalBW_AdditionalBW_None)
-const AdditionalBW_AdditionalBW_NA = AdditionalBW(tech_profile.AdditionalBW_AdditionalBW_NA)
-const AdditionalBW_AdditionalBW_BestEffort = AdditionalBW(tech_profile.AdditionalBW_AdditionalBW_BestEffort)
-const AdditionalBW_AdditionalBW_Auto = AdditionalBW(tech_profile.AdditionalBW_AdditionalBW_Auto)
-
-// DiscardPolicy from public import voltha_protos/tech_profile.proto
-type DiscardPolicy = tech_profile.DiscardPolicy
-
-var DiscardPolicy_name = tech_profile.DiscardPolicy_name
-var DiscardPolicy_value = tech_profile.DiscardPolicy_value
-
-const DiscardPolicy_TailDrop = DiscardPolicy(tech_profile.DiscardPolicy_TailDrop)
-const DiscardPolicy_WTailDrop = DiscardPolicy(tech_profile.DiscardPolicy_WTailDrop)
-const DiscardPolicy_Red = DiscardPolicy(tech_profile.DiscardPolicy_Red)
-const DiscardPolicy_WRed = DiscardPolicy(tech_profile.DiscardPolicy_WRed)
-
-// InferredAdditionBWIndication from public import voltha_protos/tech_profile.proto
-type InferredAdditionBWIndication = tech_profile.InferredAdditionBWIndication
-
-var InferredAdditionBWIndication_name = tech_profile.InferredAdditionBWIndication_name
-var InferredAdditionBWIndication_value = tech_profile.InferredAdditionBWIndication_value
-
-const InferredAdditionBWIndication_InferredAdditionBWIndication_None = InferredAdditionBWIndication(tech_profile.InferredAdditionBWIndication_InferredAdditionBWIndication_None)
-const InferredAdditionBWIndication_InferredAdditionBWIndication_Assured = InferredAdditionBWIndication(tech_profile.InferredAdditionBWIndication_InferredAdditionBWIndication_Assured)
-const InferredAdditionBWIndication_InferredAdditionBWIndication_BestEffort = InferredAdditionBWIndication(tech_profile.InferredAdditionBWIndication_InferredAdditionBWIndication_BestEffort)
-
-type DeviceInfo_DeviceResourceRanges_Pool_PoolType int32
-
-const (
-	DeviceInfo_DeviceResourceRanges_Pool_ONU_ID     DeviceInfo_DeviceResourceRanges_Pool_PoolType = 0
-	DeviceInfo_DeviceResourceRanges_Pool_ALLOC_ID   DeviceInfo_DeviceResourceRanges_Pool_PoolType = 1
-	DeviceInfo_DeviceResourceRanges_Pool_GEMPORT_ID DeviceInfo_DeviceResourceRanges_Pool_PoolType = 2
-	DeviceInfo_DeviceResourceRanges_Pool_FLOW_ID    DeviceInfo_DeviceResourceRanges_Pool_PoolType = 3
-)
-
-var DeviceInfo_DeviceResourceRanges_Pool_PoolType_name = map[int32]string{
-	0: "ONU_ID",
-	1: "ALLOC_ID",
-	2: "GEMPORT_ID",
-	3: "FLOW_ID",
-}
-
-var DeviceInfo_DeviceResourceRanges_Pool_PoolType_value = map[string]int32{
-	"ONU_ID":     0,
-	"ALLOC_ID":   1,
-	"GEMPORT_ID": 2,
-	"FLOW_ID":    3,
-}
-
-func (x DeviceInfo_DeviceResourceRanges_Pool_PoolType) String() string {
-	return proto.EnumName(DeviceInfo_DeviceResourceRanges_Pool_PoolType_name, int32(x))
-}
-
-func (DeviceInfo_DeviceResourceRanges_Pool_PoolType) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{15, 0, 0, 0}
-}
-
-type DeviceInfo_DeviceResourceRanges_Pool_SharingType int32
-
-const (
-	DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF           DeviceInfo_DeviceResourceRanges_Pool_SharingType = 0
-	DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_ALL_TECH  DeviceInfo_DeviceResourceRanges_Pool_SharingType = 1
-	DeviceInfo_DeviceResourceRanges_Pool_SHARED_BY_ALL_INTF_SAME_TECH DeviceInfo_DeviceResourceRanges_Pool_SharingType = 2
-)
-
-var DeviceInfo_DeviceResourceRanges_Pool_SharingType_name = map[int32]string{
-	0: "DEDICATED_PER_INTF",
-	1: "SHARED_BY_ALL_INTF_ALL_TECH",
-	2: "SHARED_BY_ALL_INTF_SAME_TECH",
-}
-
-var DeviceInfo_DeviceResourceRanges_Pool_SharingType_value = map[string]int32{
-	"DEDICATED_PER_INTF":           0,
-	"SHARED_BY_ALL_INTF_ALL_TECH":  1,
-	"SHARED_BY_ALL_INTF_SAME_TECH": 2,
-}
-
-func (x DeviceInfo_DeviceResourceRanges_Pool_SharingType) String() string {
-	return proto.EnumName(DeviceInfo_DeviceResourceRanges_Pool_SharingType_name, int32(x))
-}
-
-func (DeviceInfo_DeviceResourceRanges_Pool_SharingType) EnumDescriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{15, 0, 0, 1}
-}
-
-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_c072e7aa0dfd74d5, []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 (m *Indication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Indication.Merge(m, 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,proto3,oneof"`
-}
-
-type Indication_IntfInd struct {
-	IntfInd *IntfIndication `protobuf:"bytes,2,opt,name=intf_ind,json=intfInd,proto3,oneof"`
-}
-
-type Indication_IntfOperInd struct {
-	IntfOperInd *IntfOperIndication `protobuf:"bytes,3,opt,name=intf_oper_ind,json=intfOperInd,proto3,oneof"`
-}
-
-type Indication_OnuDiscInd struct {
-	OnuDiscInd *OnuDiscIndication `protobuf:"bytes,4,opt,name=onu_disc_ind,json=onuDiscInd,proto3,oneof"`
-}
-
-type Indication_OnuInd struct {
-	OnuInd *OnuIndication `protobuf:"bytes,5,opt,name=onu_ind,json=onuInd,proto3,oneof"`
-}
-
-type Indication_OmciInd struct {
-	OmciInd *OmciIndication `protobuf:"bytes,6,opt,name=omci_ind,json=omciInd,proto3,oneof"`
-}
-
-type Indication_PktInd struct {
-	PktInd *PacketIndication `protobuf:"bytes,7,opt,name=pkt_ind,json=pktInd,proto3,oneof"`
-}
-
-type Indication_PortStats struct {
-	PortStats *PortStatistics `protobuf:"bytes,8,opt,name=port_stats,json=portStats,proto3,oneof"`
-}
-
-type Indication_FlowStats struct {
-	FlowStats *FlowStatistics `protobuf:"bytes,9,opt,name=flow_stats,json=flowStats,proto3,oneof"`
-}
-
-type Indication_AlarmInd struct {
-	AlarmInd *AlarmIndication `protobuf:"bytes,10,opt,name=alarm_ind,json=alarmInd,proto3,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_OneofWrappers is for the internal use of the proto package.
-func (*Indication) XXX_OneofWrappers() []interface{} {
-	return []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),
-	}
-}
-
-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_c072e7aa0dfd74d5, []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 (m *AlarmIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_AlarmIndication.Merge(m, 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,proto3,oneof"`
-}
-
-type AlarmIndication_DyingGaspInd struct {
-	DyingGaspInd *DyingGaspIndication `protobuf:"bytes,2,opt,name=dying_gasp_ind,json=dyingGaspInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuAlarmInd struct {
-	OnuAlarmInd *OnuAlarmIndication `protobuf:"bytes,3,opt,name=onu_alarm_ind,json=onuAlarmInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuStartupFailInd struct {
-	OnuStartupFailInd *OnuStartupFailureIndication `protobuf:"bytes,4,opt,name=onu_startup_fail_ind,json=onuStartupFailInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuSignalDegradeInd struct {
-	OnuSignalDegradeInd *OnuSignalDegradeIndication `protobuf:"bytes,5,opt,name=onu_signal_degrade_ind,json=onuSignalDegradeInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuDriftOfWindowInd struct {
-	OnuDriftOfWindowInd *OnuDriftOfWindowIndication `protobuf:"bytes,6,opt,name=onu_drift_of_window_ind,json=onuDriftOfWindowInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuLossOmciInd struct {
-	OnuLossOmciInd *OnuLossOfOmciChannelIndication `protobuf:"bytes,7,opt,name=onu_loss_omci_ind,json=onuLossOmciInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuSignalsFailInd struct {
-	OnuSignalsFailInd *OnuSignalsFailureIndication `protobuf:"bytes,8,opt,name=onu_signals_fail_ind,json=onuSignalsFailInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuTiwiInd struct {
-	OnuTiwiInd *OnuTransmissionInterferenceWarning `protobuf:"bytes,9,opt,name=onu_tiwi_ind,json=onuTiwiInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuActivationFailInd struct {
-	OnuActivationFailInd *OnuActivationFailureIndication `protobuf:"bytes,10,opt,name=onu_activation_fail_ind,json=onuActivationFailInd,proto3,oneof"`
-}
-
-type AlarmIndication_OnuProcessingErrorInd struct {
-	OnuProcessingErrorInd *OnuProcessingErrorIndication `protobuf:"bytes,11,opt,name=onu_processing_error_ind,json=onuProcessingErrorInd,proto3,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_OneofWrappers is for the internal use of the proto package.
-func (*AlarmIndication) XXX_OneofWrappers() []interface{} {
-	return []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),
-	}
-}
-
-type OltIndication struct {
-	OperState            string   `protobuf:"bytes,1,opt,name=oper_state,json=operState,proto3" 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_c072e7aa0dfd74d5, []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 (m *OltIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OltIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OperState            string   `protobuf:"bytes,2,opt,name=oper_state,json=operState,proto3" 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_c072e7aa0dfd74d5, []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 (m *IntfIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_IntfIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	SerialNumber         *SerialNumber `protobuf:"bytes,2,opt,name=serial_number,json=serialNumber,proto3" 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_c072e7aa0dfd74d5, []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 (m *OnuDiscIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuDiscIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32        `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	OperState            string        `protobuf:"bytes,3,opt,name=oper_state,json=operState,proto3" json:"oper_state,omitempty"`
-	AdminState           string        `protobuf:"bytes,5,opt,name=admin_state,json=adminState,proto3" json:"admin_state,omitempty"`
-	SerialNumber         *SerialNumber `protobuf:"bytes,4,opt,name=serial_number,json=serialNumber,proto3" 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_c072e7aa0dfd74d5, []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 (m *OnuIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuIndication.Merge(m, 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,proto3" json:"type,omitempty"`
-	IntfId               uint32   `protobuf:"fixed32,2,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
-	OperState            string   `protobuf:"bytes,3,opt,name=oper_state,json=operState,proto3" 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_c072e7aa0dfd74d5, []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 (m *IntfOperIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_IntfOperIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" 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_c072e7aa0dfd74d5, []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 (m *OmciIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OmciIndication.Merge(m, 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 {
-	IntfType             string   `protobuf:"bytes,5,opt,name=intf_type,json=intfType,proto3" json:"intf_type,omitempty"`
-	IntfId               uint32   `protobuf:"fixed32,1,opt,name=intf_id,json=intfId,proto3" json:"intf_id,omitempty"`
-	GemportId            uint32   `protobuf:"fixed32,2,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_id,omitempty"`
-	FlowId               uint32   `protobuf:"fixed32,3,opt,name=flow_id,json=flowId,proto3" json:"flow_id,omitempty"`
-	PortNo               uint32   `protobuf:"fixed32,6,opt,name=port_no,json=portNo,proto3" json:"port_no,omitempty"`
-	Cookie               uint64   `protobuf:"fixed64,7,opt,name=cookie,proto3" json:"cookie,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_c072e7aa0dfd74d5, []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 (m *PacketIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_PacketIndication.Merge(m, 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) GetIntfType() string {
-	if m != nil {
-		return m.IntfType
-	}
-	return ""
-}
-
-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) GetPortNo() uint32 {
-	if m != nil {
-		return m.PortNo
-	}
-	return 0
-}
-
-func (m *PacketIndication) GetCookie() uint64 {
-	if m != nil {
-		return m.Cookie
-	}
-	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,proto3" 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_c072e7aa0dfd74d5, []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 (m *Interface) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Interface.Merge(m, 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,proto3" 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_c072e7aa0dfd74d5, []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 (m *Heartbeat) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Heartbeat.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32        `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	SerialNumber         *SerialNumber `protobuf:"bytes,3,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"`
-	Pir                  uint32        `protobuf:"fixed32,4,opt,name=pir,proto3" 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_c072e7aa0dfd74d5, []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 (m *Onu) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Onu.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" 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_c072e7aa0dfd74d5, []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 (m *OmciMsg) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OmciMsg.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	PortNo               uint32   `protobuf:"fixed32,4,opt,name=port_no,json=portNo,proto3" json:"port_no,omitempty"`
-	GemportId            uint32   `protobuf:"fixed32,5,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_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_c072e7aa0dfd74d5, []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 (m *OnuPacket) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuPacket.Merge(m, 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) GetPortNo() uint32 {
-	if m != nil {
-		return m.PortNo
-	}
-	return 0
-}
-
-func (m *OnuPacket) GetGemportId() uint32 {
-	if m != nil {
-		return m.GemportId
-	}
-	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,proto3" 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_c072e7aa0dfd74d5, []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 (m *UplinkPacket) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_UplinkPacket.Merge(m, 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 DeviceInfo struct {
-	Vendor             string `protobuf:"bytes,1,opt,name=vendor,proto3" json:"vendor,omitempty"`
-	Model              string `protobuf:"bytes,2,opt,name=model,proto3" json:"model,omitempty"`
-	HardwareVersion    string `protobuf:"bytes,3,opt,name=hardware_version,json=hardwareVersion,proto3" json:"hardware_version,omitempty"`
-	FirmwareVersion    string `protobuf:"bytes,4,opt,name=firmware_version,json=firmwareVersion,proto3" json:"firmware_version,omitempty"`
-	DeviceId           string `protobuf:"bytes,16,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
-	DeviceSerialNumber string `protobuf:"bytes,17,opt,name=device_serial_number,json=deviceSerialNumber,proto3" json:"device_serial_number,omitempty"`
-	// Total number of pon intf ports on the device
-	PonPorts uint32 `protobuf:"fixed32,12,opt,name=pon_ports,json=ponPorts,proto3" json:"pon_ports,omitempty"`
-	// If using global per-device technology profile. To be deprecated
-	Technology           string                             `protobuf:"bytes,5,opt,name=technology,proto3" json:"technology,omitempty"`
-	OnuIdStart           uint32                             `protobuf:"fixed32,6,opt,name=onu_id_start,json=onuIdStart,proto3" json:"onu_id_start,omitempty"`
-	OnuIdEnd             uint32                             `protobuf:"fixed32,7,opt,name=onu_id_end,json=onuIdEnd,proto3" json:"onu_id_end,omitempty"`
-	AllocIdStart         uint32                             `protobuf:"fixed32,8,opt,name=alloc_id_start,json=allocIdStart,proto3" json:"alloc_id_start,omitempty"`
-	AllocIdEnd           uint32                             `protobuf:"fixed32,9,opt,name=alloc_id_end,json=allocIdEnd,proto3" json:"alloc_id_end,omitempty"`
-	GemportIdStart       uint32                             `protobuf:"fixed32,10,opt,name=gemport_id_start,json=gemportIdStart,proto3" json:"gemport_id_start,omitempty"`
-	GemportIdEnd         uint32                             `protobuf:"fixed32,11,opt,name=gemport_id_end,json=gemportIdEnd,proto3" json:"gemport_id_end,omitempty"`
-	FlowIdStart          uint32                             `protobuf:"fixed32,13,opt,name=flow_id_start,json=flowIdStart,proto3" json:"flow_id_start,omitempty"`
-	FlowIdEnd            uint32                             `protobuf:"fixed32,14,opt,name=flow_id_end,json=flowIdEnd,proto3" json:"flow_id_end,omitempty"`
-	Ranges               []*DeviceInfo_DeviceResourceRanges `protobuf:"bytes,15,rep,name=ranges,proto3" json:"ranges,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                           `json:"-"`
-	XXX_unrecognized     []byte                             `json:"-"`
-	XXX_sizecache        int32                              `json:"-"`
-}
-
-func (m *DeviceInfo) Reset()         { *m = DeviceInfo{} }
-func (m *DeviceInfo) String() string { return proto.CompactTextString(m) }
-func (*DeviceInfo) ProtoMessage()    {}
-func (*DeviceInfo) Descriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{15}
-}
-
-func (m *DeviceInfo) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_DeviceInfo.Unmarshal(m, b)
-}
-func (m *DeviceInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_DeviceInfo.Marshal(b, m, deterministic)
-}
-func (m *DeviceInfo) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_DeviceInfo.Merge(m, src)
-}
-func (m *DeviceInfo) XXX_Size() int {
-	return xxx_messageInfo_DeviceInfo.Size(m)
-}
-func (m *DeviceInfo) XXX_DiscardUnknown() {
-	xxx_messageInfo_DeviceInfo.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeviceInfo proto.InternalMessageInfo
-
-func (m *DeviceInfo) GetVendor() string {
-	if m != nil {
-		return m.Vendor
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetModel() string {
-	if m != nil {
-		return m.Model
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetHardwareVersion() string {
-	if m != nil {
-		return m.HardwareVersion
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetFirmwareVersion() string {
-	if m != nil {
-		return m.FirmwareVersion
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetDeviceId() string {
-	if m != nil {
-		return m.DeviceId
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetDeviceSerialNumber() string {
-	if m != nil {
-		return m.DeviceSerialNumber
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetPonPorts() uint32 {
-	if m != nil {
-		return m.PonPorts
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetTechnology() string {
-	if m != nil {
-		return m.Technology
-	}
-	return ""
-}
-
-func (m *DeviceInfo) GetOnuIdStart() uint32 {
-	if m != nil {
-		return m.OnuIdStart
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetOnuIdEnd() uint32 {
-	if m != nil {
-		return m.OnuIdEnd
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetAllocIdStart() uint32 {
-	if m != nil {
-		return m.AllocIdStart
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetAllocIdEnd() uint32 {
-	if m != nil {
-		return m.AllocIdEnd
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetGemportIdStart() uint32 {
-	if m != nil {
-		return m.GemportIdStart
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetGemportIdEnd() uint32 {
-	if m != nil {
-		return m.GemportIdEnd
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetFlowIdStart() uint32 {
-	if m != nil {
-		return m.FlowIdStart
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetFlowIdEnd() uint32 {
-	if m != nil {
-		return m.FlowIdEnd
-	}
-	return 0
-}
-
-func (m *DeviceInfo) GetRanges() []*DeviceInfo_DeviceResourceRanges {
-	if m != nil {
-		return m.Ranges
-	}
-	return nil
-}
-
-type DeviceInfo_DeviceResourceRanges struct {
-	// List of 0 or more intf_ids that use the same technology and pools.
-	// If 0 intf_ids supplied, it implies ALL interfaces
-	IntfIds []uint32 `protobuf:"fixed32,1,rep,packed,name=intf_ids,json=intfIds,proto3" json:"intf_ids,omitempty"`
-	// Technology profile for this pool
-	Technology           string                                  `protobuf:"bytes,2,opt,name=technology,proto3" json:"technology,omitempty"`
-	Pools                []*DeviceInfo_DeviceResourceRanges_Pool `protobuf:"bytes,3,rep,name=pools,proto3" json:"pools,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                                `json:"-"`
-	XXX_unrecognized     []byte                                  `json:"-"`
-	XXX_sizecache        int32                                   `json:"-"`
-}
-
-func (m *DeviceInfo_DeviceResourceRanges) Reset()         { *m = DeviceInfo_DeviceResourceRanges{} }
-func (m *DeviceInfo_DeviceResourceRanges) String() string { return proto.CompactTextString(m) }
-func (*DeviceInfo_DeviceResourceRanges) ProtoMessage()    {}
-func (*DeviceInfo_DeviceResourceRanges) Descriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{15, 0}
-}
-
-func (m *DeviceInfo_DeviceResourceRanges) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges.Unmarshal(m, b)
-}
-func (m *DeviceInfo_DeviceResourceRanges) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges.Marshal(b, m, deterministic)
-}
-func (m *DeviceInfo_DeviceResourceRanges) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_DeviceInfo_DeviceResourceRanges.Merge(m, src)
-}
-func (m *DeviceInfo_DeviceResourceRanges) XXX_Size() int {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges.Size(m)
-}
-func (m *DeviceInfo_DeviceResourceRanges) XXX_DiscardUnknown() {
-	xxx_messageInfo_DeviceInfo_DeviceResourceRanges.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeviceInfo_DeviceResourceRanges proto.InternalMessageInfo
-
-func (m *DeviceInfo_DeviceResourceRanges) GetIntfIds() []uint32 {
-	if m != nil {
-		return m.IntfIds
-	}
-	return nil
-}
-
-func (m *DeviceInfo_DeviceResourceRanges) GetTechnology() string {
-	if m != nil {
-		return m.Technology
-	}
-	return ""
-}
-
-func (m *DeviceInfo_DeviceResourceRanges) GetPools() []*DeviceInfo_DeviceResourceRanges_Pool {
-	if m != nil {
-		return m.Pools
-	}
-	return nil
-}
-
-type DeviceInfo_DeviceResourceRanges_Pool struct {
-	Type                 DeviceInfo_DeviceResourceRanges_Pool_PoolType    `protobuf:"varint,1,opt,name=type,proto3,enum=openolt.DeviceInfo_DeviceResourceRanges_Pool_PoolType" json:"type,omitempty"`
-	Sharing              DeviceInfo_DeviceResourceRanges_Pool_SharingType `protobuf:"varint,2,opt,name=sharing,proto3,enum=openolt.DeviceInfo_DeviceResourceRanges_Pool_SharingType" json:"sharing,omitempty"`
-	Start                uint32                                           `protobuf:"fixed32,3,opt,name=start,proto3" json:"start,omitempty"`
-	End                  uint32                                           `protobuf:"fixed32,4,opt,name=end,proto3" json:"end,omitempty"`
-	XXX_NoUnkeyedLiteral struct{}                                         `json:"-"`
-	XXX_unrecognized     []byte                                           `json:"-"`
-	XXX_sizecache        int32                                            `json:"-"`
-}
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) Reset()         { *m = DeviceInfo_DeviceResourceRanges_Pool{} }
-func (m *DeviceInfo_DeviceResourceRanges_Pool) String() string { return proto.CompactTextString(m) }
-func (*DeviceInfo_DeviceResourceRanges_Pool) ProtoMessage()    {}
-func (*DeviceInfo_DeviceResourceRanges_Pool) Descriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{15, 0, 0}
-}
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool.Unmarshal(m, b)
-}
-func (m *DeviceInfo_DeviceResourceRanges_Pool) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool.Marshal(b, m, deterministic)
-}
-func (m *DeviceInfo_DeviceResourceRanges_Pool) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool.Merge(m, src)
-}
-func (m *DeviceInfo_DeviceResourceRanges_Pool) XXX_Size() int {
-	return xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool.Size(m)
-}
-func (m *DeviceInfo_DeviceResourceRanges_Pool) XXX_DiscardUnknown() {
-	xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_DeviceInfo_DeviceResourceRanges_Pool proto.InternalMessageInfo
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) GetType() DeviceInfo_DeviceResourceRanges_Pool_PoolType {
-	if m != nil {
-		return m.Type
-	}
-	return DeviceInfo_DeviceResourceRanges_Pool_ONU_ID
-}
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) GetSharing() DeviceInfo_DeviceResourceRanges_Pool_SharingType {
-	if m != nil {
-		return m.Sharing
-	}
-	return DeviceInfo_DeviceResourceRanges_Pool_DEDICATED_PER_INTF
-}
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) GetStart() uint32 {
-	if m != nil {
-		return m.Start
-	}
-	return 0
-}
-
-func (m *DeviceInfo_DeviceResourceRanges_Pool) GetEnd() uint32 {
-	if m != nil {
-		return m.End
-	}
-	return 0
-}
-
-type Classifier struct {
-	OTpid                uint32   `protobuf:"fixed32,1,opt,name=o_tpid,json=oTpid,proto3" json:"o_tpid,omitempty"`
-	OVid                 uint32   `protobuf:"fixed32,2,opt,name=o_vid,json=oVid,proto3" json:"o_vid,omitempty"`
-	ITpid                uint32   `protobuf:"fixed32,3,opt,name=i_tpid,json=iTpid,proto3" json:"i_tpid,omitempty"`
-	IVid                 uint32   `protobuf:"fixed32,4,opt,name=i_vid,json=iVid,proto3" json:"i_vid,omitempty"`
-	OPbits               uint32   `protobuf:"fixed32,5,opt,name=o_pbits,json=oPbits,proto3" json:"o_pbits,omitempty"`
-	IPbits               uint32   `protobuf:"fixed32,6,opt,name=i_pbits,json=iPbits,proto3" json:"i_pbits,omitempty"`
-	EthType              uint32   `protobuf:"fixed32,7,opt,name=eth_type,json=ethType,proto3" 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,proto3" json:"ip_proto,omitempty"`
-	DstIp                uint32   `protobuf:"fixed32,11,opt,name=dst_ip,json=dstIp,proto3" json:"dst_ip,omitempty"`
-	SrcIp                uint32   `protobuf:"fixed32,12,opt,name=src_ip,json=srcIp,proto3" json:"src_ip,omitempty"`
-	SrcPort              uint32   `protobuf:"fixed32,13,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"`
-	DstPort              uint32   `protobuf:"fixed32,14,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"`
-	PktTagType           string   `protobuf:"bytes,15,opt,name=pkt_tag_type,json=pktTagType,proto3" 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_c072e7aa0dfd74d5, []int{16}
-}
-
-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 (m *Classifier) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Classifier.Merge(m, 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,proto3" json:"add_outer_tag,omitempty"`
-	RemoveOuterTag       bool     `protobuf:"varint,2,opt,name=remove_outer_tag,json=removeOuterTag,proto3" json:"remove_outer_tag,omitempty"`
-	TrapToHost           bool     `protobuf:"varint,3,opt,name=trap_to_host,json=trapToHost,proto3" 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_c072e7aa0dfd74d5, []int{17}
-}
-
-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 (m *ActionCmd) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_ActionCmd.Merge(m, 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,proto3" json:"cmd,omitempty"`
-	OVid                 uint32     `protobuf:"fixed32,2,opt,name=o_vid,json=oVid,proto3" json:"o_vid,omitempty"`
-	OPbits               uint32     `protobuf:"fixed32,3,opt,name=o_pbits,json=oPbits,proto3" json:"o_pbits,omitempty"`
-	OTpid                uint32     `protobuf:"fixed32,4,opt,name=o_tpid,json=oTpid,proto3" json:"o_tpid,omitempty"`
-	IVid                 uint32     `protobuf:"fixed32,5,opt,name=i_vid,json=iVid,proto3" json:"i_vid,omitempty"`
-	IPbits               uint32     `protobuf:"fixed32,6,opt,name=i_pbits,json=iPbits,proto3" json:"i_pbits,omitempty"`
-	ITpid                uint32     `protobuf:"fixed32,7,opt,name=i_tpid,json=iTpid,proto3" 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_c072e7aa0dfd74d5, []int{18}
-}
-
-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 (m *Action) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Action.Merge(m, 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         int32       `protobuf:"fixed32,1,opt,name=access_intf_id,json=accessIntfId,proto3" json:"access_intf_id,omitempty"`
-	OnuId                int32       `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	UniId                int32       `protobuf:"fixed32,11,opt,name=uni_id,json=uniId,proto3" json:"uni_id,omitempty"`
-	FlowId               uint32      `protobuf:"fixed32,3,opt,name=flow_id,json=flowId,proto3" json:"flow_id,omitempty"`
-	FlowType             string      `protobuf:"bytes,4,opt,name=flow_type,json=flowType,proto3" json:"flow_type,omitempty"`
-	AllocId              int32       `protobuf:"fixed32,10,opt,name=alloc_id,json=allocId,proto3" json:"alloc_id,omitempty"`
-	NetworkIntfId        int32       `protobuf:"fixed32,5,opt,name=network_intf_id,json=networkIntfId,proto3" json:"network_intf_id,omitempty"`
-	GemportId            int32       `protobuf:"fixed32,6,opt,name=gemport_id,json=gemportId,proto3" json:"gemport_id,omitempty"`
-	Classifier           *Classifier `protobuf:"bytes,7,opt,name=classifier,proto3" json:"classifier,omitempty"`
-	Action               *Action     `protobuf:"bytes,8,opt,name=action,proto3" json:"action,omitempty"`
-	Priority             int32       `protobuf:"fixed32,9,opt,name=priority,proto3" json:"priority,omitempty"`
-	Cookie               uint64      `protobuf:"fixed64,12,opt,name=cookie,proto3" json:"cookie,omitempty"`
-	PortNo               uint32      `protobuf:"fixed32,13,opt,name=port_no,json=portNo,proto3" json:"port_no,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_c072e7aa0dfd74d5, []int{19}
-}
-
-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 (m *Flow) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Flow.Merge(m, 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() int32 {
-	if m != nil {
-		return m.AccessIntfId
-	}
-	return 0
-}
-
-func (m *Flow) GetOnuId() int32 {
-	if m != nil {
-		return m.OnuId
-	}
-	return 0
-}
-
-func (m *Flow) GetUniId() int32 {
-	if m != nil {
-		return m.UniId
-	}
-	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) GetAllocId() int32 {
-	if m != nil {
-		return m.AllocId
-	}
-	return 0
-}
-
-func (m *Flow) GetNetworkIntfId() int32 {
-	if m != nil {
-		return m.NetworkIntfId
-	}
-	return 0
-}
-
-func (m *Flow) GetGemportId() int32 {
-	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() int32 {
-	if m != nil {
-		return m.Priority
-	}
-	return 0
-}
-
-func (m *Flow) GetCookie() uint64 {
-	if m != nil {
-		return m.Cookie
-	}
-	return 0
-}
-
-func (m *Flow) GetPortNo() uint32 {
-	if m != nil {
-		return m.PortNo
-	}
-	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_c072e7aa0dfd74d5, []int{20}
-}
-
-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 (m *SerialNumber) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_SerialNumber.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	RxBytes              uint64   `protobuf:"fixed64,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"`
-	RxPackets            uint64   `protobuf:"fixed64,3,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"`
-	RxUcastPackets       uint64   `protobuf:"fixed64,4,opt,name=rx_ucast_packets,json=rxUcastPackets,proto3" json:"rx_ucast_packets,omitempty"`
-	RxMcastPackets       uint64   `protobuf:"fixed64,5,opt,name=rx_mcast_packets,json=rxMcastPackets,proto3" json:"rx_mcast_packets,omitempty"`
-	RxBcastPackets       uint64   `protobuf:"fixed64,6,opt,name=rx_bcast_packets,json=rxBcastPackets,proto3" json:"rx_bcast_packets,omitempty"`
-	RxErrorPackets       uint64   `protobuf:"fixed64,7,opt,name=rx_error_packets,json=rxErrorPackets,proto3" json:"rx_error_packets,omitempty"`
-	TxBytes              uint64   `protobuf:"fixed64,8,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
-	TxPackets            uint64   `protobuf:"fixed64,9,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"`
-	TxUcastPackets       uint64   `protobuf:"fixed64,10,opt,name=tx_ucast_packets,json=txUcastPackets,proto3" json:"tx_ucast_packets,omitempty"`
-	TxMcastPackets       uint64   `protobuf:"fixed64,11,opt,name=tx_mcast_packets,json=txMcastPackets,proto3" json:"tx_mcast_packets,omitempty"`
-	TxBcastPackets       uint64   `protobuf:"fixed64,12,opt,name=tx_bcast_packets,json=txBcastPackets,proto3" json:"tx_bcast_packets,omitempty"`
-	TxErrorPackets       uint64   `protobuf:"fixed64,13,opt,name=tx_error_packets,json=txErrorPackets,proto3" json:"tx_error_packets,omitempty"`
-	RxCrcErrors          uint64   `protobuf:"fixed64,14,opt,name=rx_crc_errors,json=rxCrcErrors,proto3" json:"rx_crc_errors,omitempty"`
-	BipErrors            uint64   `protobuf:"fixed64,15,opt,name=bip_errors,json=bipErrors,proto3" json:"bip_errors,omitempty"`
-	Timestamp            uint32   `protobuf:"fixed32,16,opt,name=timestamp,proto3" 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_c072e7aa0dfd74d5, []int{21}
-}
-
-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 (m *PortStatistics) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_PortStatistics.Merge(m, 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,proto3" json:"flow_id,omitempty"`
-	RxBytes              uint64   `protobuf:"fixed64,2,opt,name=rx_bytes,json=rxBytes,proto3" json:"rx_bytes,omitempty"`
-	RxPackets            uint64   `protobuf:"fixed64,3,opt,name=rx_packets,json=rxPackets,proto3" json:"rx_packets,omitempty"`
-	TxBytes              uint64   `protobuf:"fixed64,8,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
-	TxPackets            uint64   `protobuf:"fixed64,9,opt,name=tx_packets,json=txPackets,proto3" json:"tx_packets,omitempty"`
-	Timestamp            uint32   `protobuf:"fixed32,16,opt,name=timestamp,proto3" 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_c072e7aa0dfd74d5, []int{22}
-}
-
-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 (m *FlowStatistics) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_FlowStatistics.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	Status               string   `protobuf:"bytes,2,opt,name=status,proto3" 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_c072e7aa0dfd74d5, []int{23}
-}
-
-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 (m *LosIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_LosIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	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_c072e7aa0dfd74d5, []int{24}
-}
-
-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 (m *DyingGaspIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_DyingGaspIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	LosStatus            string   `protobuf:"bytes,3,opt,name=los_status,json=losStatus,proto3" json:"los_status,omitempty"`
-	LobStatus            string   `protobuf:"bytes,4,opt,name=lob_status,json=lobStatus,proto3" json:"lob_status,omitempty"`
-	LopcMissStatus       string   `protobuf:"bytes,5,opt,name=lopc_miss_status,json=lopcMissStatus,proto3" json:"lopc_miss_status,omitempty"`
-	LopcMicErrorStatus   string   `protobuf:"bytes,6,opt,name=lopc_mic_error_status,json=lopcMicErrorStatus,proto3" 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_c072e7aa0dfd74d5, []int{25}
-}
-
-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 (m *OnuAlarmIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuAlarmIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	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_c072e7aa0dfd74d5, []int{26}
-}
-
-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 (m *OnuStartupFailureIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuStartupFailureIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	InverseBitErrorRate  uint32   `protobuf:"fixed32,4,opt,name=inverse_bit_error_rate,json=inverseBitErrorRate,proto3" 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_c072e7aa0dfd74d5, []int{27}
-}
-
-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 (m *OnuSignalDegradeIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuSignalDegradeIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	Drift                uint32   `protobuf:"fixed32,4,opt,name=drift,proto3" json:"drift,omitempty"`
-	NewEqd               uint32   `protobuf:"fixed32,5,opt,name=new_eqd,json=newEqd,proto3" 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_c072e7aa0dfd74d5, []int{28}
-}
-
-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 (m *OnuDriftOfWindowIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuDriftOfWindowIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	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_c072e7aa0dfd74d5, []int{29}
-}
-
-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 (m *OnuLossOfOmciChannelIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuLossOfOmciChannelIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	InverseBitErrorRate  uint32   `protobuf:"fixed32,4,opt,name=inverse_bit_error_rate,json=inverseBitErrorRate,proto3" 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_c072e7aa0dfd74d5, []int{30}
-}
-
-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 (m *OnuSignalsFailureIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuSignalsFailureIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	Status               string   `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
-	Drift                uint32   `protobuf:"fixed32,4,opt,name=drift,proto3" 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_c072e7aa0dfd74d5, []int{31}
-}
-
-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 (m *OnuTransmissionInterferenceWarning) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuTransmissionInterferenceWarning.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *OnuActivationFailureIndication) Reset()         { *m = OnuActivationFailureIndication{} }
-func (m *OnuActivationFailureIndication) String() string { return proto.CompactTextString(m) }
-func (*OnuActivationFailureIndication) ProtoMessage()    {}
-func (*OnuActivationFailureIndication) Descriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{32}
-}
-
-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 (m *OnuActivationFailureIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuActivationFailureIndication.Merge(m, 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,proto3" json:"intf_id,omitempty"`
-	OnuId                uint32   `protobuf:"fixed32,2,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *OnuProcessingErrorIndication) Reset()         { *m = OnuProcessingErrorIndication{} }
-func (m *OnuProcessingErrorIndication) String() string { return proto.CompactTextString(m) }
-func (*OnuProcessingErrorIndication) ProtoMessage()    {}
-func (*OnuProcessingErrorIndication) Descriptor() ([]byte, []int) {
-	return fileDescriptor_c072e7aa0dfd74d5, []int{33}
-}
-
-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 (m *OnuProcessingErrorIndication) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_OnuProcessingErrorIndication.Merge(m, 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_c072e7aa0dfd74d5, []int{34}
-}
-
-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 (m *Empty) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Empty.Merge(m, 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.RegisterEnum("openolt.DeviceInfo_DeviceResourceRanges_Pool_PoolType", DeviceInfo_DeviceResourceRanges_Pool_PoolType_name, DeviceInfo_DeviceResourceRanges_Pool_PoolType_value)
-	proto.RegisterEnum("openolt.DeviceInfo_DeviceResourceRanges_Pool_SharingType", DeviceInfo_DeviceResourceRanges_Pool_SharingType_name, DeviceInfo_DeviceResourceRanges_Pool_SharingType_value)
-	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((*DeviceInfo)(nil), "openolt.DeviceInfo")
-	proto.RegisterType((*DeviceInfo_DeviceResourceRanges)(nil), "openolt.DeviceInfo.DeviceResourceRanges")
-	proto.RegisterType((*DeviceInfo_DeviceResourceRanges_Pool)(nil), "openolt.DeviceInfo.DeviceResourceRanges.Pool")
-	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")
-}
-
-func init() { proto.RegisterFile("voltha_protos/openolt.proto", fileDescriptor_c072e7aa0dfd74d5) }
-
-var fileDescriptor_c072e7aa0dfd74d5 = []byte{
-	// 2989 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5a, 0xdd, 0x72, 0x1b, 0xc7,
-	0xb1, 0x16, 0x48, 0x10, 0x0b, 0x34, 0x7e, 0x48, 0x0d, 0xc5, 0x1f, 0x91, 0xb4, 0xcc, 0xda, 0xa3,
-	0x63, 0xeb, 0xfc, 0x58, 0xb2, 0x65, 0xd7, 0x39, 0xb1, 0x93, 0x4a, 0x4c, 0x11, 0x94, 0x89, 0x44,
-	0x14, 0x98, 0x25, 0x65, 0x25, 0x4e, 0xa5, 0xd6, 0xcb, 0xdd, 0x01, 0x30, 0xc5, 0xc5, 0xce, 0x7a,
-	0x67, 0x40, 0x52, 0x95, 0x3b, 0x27, 0x79, 0x81, 0xb8, 0x72, 0x91, 0x54, 0xe5, 0x09, 0xf2, 0x02,
-	0xa9, 0xca, 0xa5, 0x6f, 0x53, 0xb9, 0xc9, 0x03, 0xe4, 0x26, 0x8f, 0x91, 0x8b, 0xd4, 0xf4, 0xcc,
-	0x2e, 0x76, 0x01, 0x90, 0x12, 0x1d, 0xa5, 0x72, 0xc3, 0xda, 0xe9, 0xfe, 0xfa, 0x9b, 0xe9, 0x99,
-	0xee, 0x9e, 0x1f, 0x02, 0x36, 0xcf, 0x78, 0x28, 0x07, 0x9e, 0x1b, 0x27, 0x5c, 0x72, 0xf1, 0x80,
-	0xc7, 0x34, 0xe2, 0xa1, 0xbc, 0x8f, 0x4d, 0x62, 0x99, 0xe6, 0xc6, 0x56, 0x9f, 0xf3, 0x7e, 0x48,
-	0x1f, 0x78, 0x31, 0x7b, 0xe0, 0x45, 0x11, 0x97, 0x9e, 0x64, 0x3c, 0x12, 0x1a, 0xb6, 0xb1, 0x5d,
-	0xe4, 0x90, 0xd4, 0x1f, 0xa8, 0xef, 0x1e, 0x0b, 0xa9, 0x46, 0xd8, 0x7f, 0x2a, 0x03, 0x74, 0xa2,
-	0x80, 0xf9, 0x68, 0x47, 0xde, 0x03, 0x8b, 0x87, 0xd2, 0x65, 0x51, 0xb0, 0x5e, 0xda, 0x2e, 0xdd,
-	0xab, 0x3f, 0x5c, 0xbd, 0x9f, 0x76, 0xdc, 0x0d, 0xe5, 0x18, 0xb8, 0x7f, 0xc3, 0xa9, 0x70, 0x14,
-	0x90, 0x0f, 0xa0, 0xca, 0x22, 0xd9, 0x43, 0x9b, 0x39, 0xb4, 0x59, 0xcb, 0x6c, 0x3a, 0x91, 0xec,
-	0x15, 0x8c, 0x2c, 0xa6, 0x25, 0x64, 0x07, 0x9a, 0x68, 0xc5, 0x63, 0x9a, 0xa0, 0xe9, 0x3c, 0x9a,
-	0x6e, 0x16, 0x4c, 0xbb, 0x31, 0x4d, 0x0a, 0xe6, 0x75, 0x36, 0x96, 0x92, 0xef, 0x42, 0x83, 0x47,
-	0x23, 0x37, 0x60, 0xc2, 0x47, 0x86, 0x32, 0x32, 0x6c, 0x8c, 0x07, 0x1c, 0x8d, 0xda, 0x4c, 0xf8,
-	0x05, 0x02, 0xe0, 0x99, 0x10, 0x7d, 0x8d, 0x46, 0x68, 0xba, 0x30, 0xe9, 0x6b, 0x34, 0x9a, 0xf0,
-	0x15, 0x05, 0xca, 0x57, 0x3e, 0xf4, 0x19, 0xda, 0x54, 0x26, 0x7c, 0xed, 0x0e, 0x7d, 0x56, 0xf4,
-	0x95, 0x6b, 0x09, 0xf9, 0x00, 0xac, 0xf8, 0x54, 0x4f, 0xaa, 0x85, 0x46, 0xb7, 0x33, 0xa3, 0x43,
-	0xcf, 0x3f, 0xa5, 0x13, 0xf3, 0x1a, 0x9f, 0xe2, 0xbc, 0x7e, 0x0b, 0x20, 0xe6, 0x89, 0x74, 0x85,
-	0xf4, 0xa4, 0x58, 0xaf, 0x4e, 0xf4, 0x76, 0xc8, 0x13, 0x79, 0xa4, 0x16, 0x5b, 0x48, 0xe6, 0x8b,
-	0xfd, 0x1b, 0x4e, 0x2d, 0x36, 0x12, 0xa1, 0x2c, 0x7b, 0x21, 0x3f, 0x37, 0x96, 0xb5, 0x09, 0xcb,
-	0xc7, 0x21, 0x3f, 0x2f, 0x5a, 0xf6, 0x8c, 0x44, 0x90, 0xff, 0x87, 0x9a, 0x17, 0x7a, 0xc9, 0x10,
-	0xc7, 0x0a, 0x68, 0xb8, 0x9e, 0x19, 0xee, 0x28, 0x4d, 0x61, 0xa8, 0x55, 0xcf, 0x88, 0x1e, 0x55,
-	0xa0, 0x1c, 0x78, 0xd2, 0xb3, 0x7f, 0x6f, 0xc1, 0xe2, 0x04, 0x4e, 0xcd, 0x73, 0xc8, 0xc5, 0xcc,
-	0x98, 0x7a, 0xc2, 0x45, 0xd1, 0xf7, 0x10, 0x05, 0xa4, 0x0d, 0xad, 0xe0, 0x05, 0x8b, 0xfa, 0x6e,
-	0xdf, 0x13, 0x71, 0x2e, 0xb2, 0xb6, 0x32, 0xcb, 0xb6, 0x52, 0x7f, 0xe2, 0x89, 0xb8, 0x60, 0xdf,
-	0x08, 0x72, 0x62, 0x15, 0x63, 0x6a, 0x81, 0xc7, 0x1e, 0x4d, 0xc6, 0x58, 0x37, 0x1a, 0x4d, 0x3b,
-	0x55, 0xe7, 0x63, 0x29, 0x79, 0x0e, 0xb7, 0x14, 0x85, 0x90, 0x5e, 0x22, 0x47, 0xb1, 0xdb, 0xf3,
-	0x58, 0x98, 0x8b, 0xb5, 0xbb, 0x79, 0xa6, 0x23, 0x8d, 0x79, 0xec, 0xb1, 0x70, 0x94, 0xd0, 0x02,
-	0xe5, 0x4d, 0x5e, 0x50, 0x2b, 0xe2, 0xcf, 0x60, 0x15, 0x89, 0x59, 0x3f, 0xf2, 0x42, 0x37, 0xa0,
-	0xfd, 0xc4, 0x0b, 0x68, 0x2e, 0x16, 0xff, 0xa3, 0x40, 0x8d, 0xa8, 0xb6, 0x06, 0x15, 0x98, 0x97,
-	0xf9, 0xb4, 0x96, 0xfc, 0x04, 0xd6, 0x30, 0x31, 0x12, 0xd6, 0x93, 0x2e, 0xef, 0xb9, 0xe7, 0x2c,
-	0x0a, 0xf8, 0x79, 0x2e, 0x68, 0x0b, 0xe4, 0x6d, 0x05, 0xeb, 0xf6, 0x9e, 0x23, 0x68, 0x8a, 0x7c,
-	0x52, 0x4b, 0x8e, 0x41, 0x79, 0xe3, 0x86, 0x5c, 0x08, 0x37, 0xcb, 0x05, 0x1d, 0xd6, 0x6f, 0xe7,
-	0x69, 0x9f, 0x70, 0x21, 0xba, 0x3d, 0x95, 0x14, 0xbb, 0x03, 0x2f, 0x8a, 0x68, 0x58, 0xa0, 0x6e,
-	0x71, 0x83, 0x30, 0x29, 0x92, 0xce, 0x33, 0xba, 0x22, 0xc6, 0xf3, 0x5c, 0x9d, 0x31, 0xcf, 0x1a,
-	0x73, 0xe9, 0x3c, 0x8f, 0xd5, 0x8a, 0xb8, 0xab, 0x8b, 0x84, 0x64, 0xe7, 0x7a, 0xa4, 0x3a, 0x1b,
-	0xfe, 0x27, 0x4f, 0x78, 0x9c, 0x78, 0x91, 0x18, 0x32, 0x21, 0x18, 0x8f, 0x3a, 0x91, 0xa4, 0x49,
-	0x8f, 0x26, 0x34, 0xf2, 0xe9, 0x73, 0x2f, 0x89, 0x58, 0xd4, 0x37, 0x55, 0xe3, 0x98, 0x9d, 0xe3,
-	0x48, 0x3f, 0xd7, 0x93, 0xeb, 0xf9, 0x92, 0x9d, 0x61, 0xbf, 0xe3, 0xc1, 0xc2, 0xf4, 0x2c, 0xec,
-	0x64, 0xb0, 0x59, 0xe3, 0x55, 0x3e, 0x17, 0x11, 0xba, 0x87, 0x75, 0xd5, 0x43, 0x9c, 0x70, 0x9f,
-	0x0a, 0xa1, 0xb2, 0x80, 0x26, 0x09, 0xd7, 0x55, 0xb2, 0x8e, 0x5d, 0xfc, 0x67, 0xbe, 0x8b, 0xc3,
-	0x0c, 0xb7, 0xa7, 0x60, 0x85, 0x0e, 0x56, 0xf8, 0x2c, 0x7d, 0x96, 0xad, 0xf7, 0xa1, 0x59, 0xa8,
-	0xea, 0xe4, 0x0d, 0x00, 0x2c, 0xc8, 0xaa, 0x72, 0x50, 0xcc, 0xd6, 0x9a, 0x53, 0x53, 0x12, 0x55,
-	0x1e, 0xa8, 0xbd, 0x0f, 0xad, 0x62, 0x45, 0x27, 0x6b, 0x60, 0xe9, 0xe2, 0xaf, 0x73, 0xdb, 0x72,
-	0x2a, 0x58, 0xe0, 0x83, 0x09, 0xa6, 0xb9, 0x49, 0xa6, 0x01, 0xdc, 0x9c, 0x2a, 0xcf, 0x97, 0x93,
-	0x7d, 0x04, 0x4d, 0x41, 0x13, 0xe6, 0x85, 0x6e, 0x34, 0x1a, 0x9e, 0xd0, 0xc4, 0x54, 0x83, 0x95,
-	0x6c, 0x1a, 0x8e, 0x50, 0xfb, 0x14, 0x95, 0x4e, 0x43, 0xe4, 0x5a, 0xf6, 0x1f, 0x4b, 0xd0, 0x2c,
-	0x94, 0xf3, 0xcb, 0xbb, 0x59, 0x81, 0x0a, 0x6e, 0x08, 0xba, 0xda, 0x58, 0xce, 0x82, 0xaa, 0xfa,
-	0x93, 0xae, 0xcc, 0x4f, 0xb8, 0x42, 0xde, 0x84, 0xba, 0x17, 0x0c, 0x59, 0x64, 0xf4, 0x0b, 0xa8,
-	0x07, 0x14, 0x69, 0xc0, 0xd4, 0xe8, 0xcb, 0xaf, 0x3e, 0xfa, 0xcf, 0x81, 0x4c, 0x6f, 0x84, 0x84,
-	0x40, 0x59, 0xbe, 0x88, 0xd3, 0x05, 0xc2, 0xef, 0xbc, 0x57, 0x73, 0x57, 0xac, 0xc4, 0xe4, 0xf0,
-	0x6d, 0x07, 0x5a, 0xc5, 0x9d, 0xeb, 0xda, 0xf3, 0xb3, 0x04, 0xf3, 0xf1, 0xa9, 0x44, 0xe6, 0x86,
-	0xa3, 0x3e, 0xed, 0xaf, 0x4b, 0xb0, 0x34, 0xb9, 0xb3, 0x91, 0x4d, 0xa8, 0x21, 0x2d, 0x8e, 0x5c,
-	0xcf, 0x12, 0x1e, 0x1c, 0x8e, 0x27, 0x46, 0x3f, 0x15, 0x47, 0x7d, 0x3a, 0xc4, 0x8d, 0x30, 0xeb,
-	0xb7, 0x66, 0x24, 0x9d, 0x40, 0xd9, 0xe1, 0x56, 0xc7, 0x74, 0x71, 0xb7, 0x9c, 0x8a, 0x6a, 0x6a,
-	0x05, 0x1a, 0x45, 0x1c, 0x6b, 0x9e, 0xe5, 0x54, 0x54, 0xf3, 0x29, 0x27, 0xab, 0x50, 0xf1, 0x39,
-	0x3f, 0x65, 0x14, 0x8b, 0x56, 0xc5, 0x31, 0xad, 0xd4, 0x8b, 0xf2, 0xd8, 0x8b, 0xbb, 0x50, 0xd3,
-	0xe5, 0xc0, 0xf3, 0x2f, 0x1f, 0xa0, 0xfd, 0x1d, 0xa8, 0xed, 0x53, 0x2f, 0x91, 0x27, 0xd4, 0x93,
-	0xe4, 0x01, 0x2c, 0x0f, 0xd2, 0x86, 0x2e, 0x66, 0x72, 0x94, 0x50, 0x63, 0x41, 0x32, 0xd5, 0x51,
-	0xaa, 0xb1, 0x7f, 0x5e, 0x82, 0xf9, 0x6e, 0x34, 0xba, 0xf6, 0x9c, 0x4f, 0xc5, 0xd4, 0xfc, 0x2b,
-	0xc7, 0x14, 0x7a, 0xca, 0x74, 0x14, 0x5a, 0x8e, 0xfa, 0xb4, 0x7f, 0x00, 0x96, 0x8a, 0x81, 0x03,
-	0xd1, 0x7f, 0x0d, 0x8b, 0xff, 0xcb, 0x12, 0xd4, 0x54, 0x59, 0xc2, 0xf5, 0xbf, 0x36, 0x5f, 0x6e,
-	0xdd, 0xca, 0x85, 0x75, 0x2b, 0x06, 0xc2, 0xc2, 0x64, 0x20, 0x4c, 0x8f, 0xe3, 0x43, 0x68, 0x3c,
-	0x8b, 0x43, 0x16, 0x9d, 0xbe, 0x6c, 0x24, 0xc6, 0x74, 0x6e, 0x6c, 0xfa, 0xab, 0x1a, 0x40, 0x9b,
-	0x9e, 0x31, 0x9f, 0x76, 0xa2, 0x1e, 0x86, 0xcc, 0x19, 0x8d, 0x02, 0x9e, 0x98, 0x84, 0x33, 0x2d,
-	0x72, 0x0b, 0x16, 0x86, 0x3c, 0xa0, 0xa1, 0x29, 0x6f, 0xba, 0x41, 0xfe, 0x0b, 0x96, 0x06, 0x5e,
-	0x12, 0x9c, 0x7b, 0x09, 0x75, 0xcf, 0x68, 0xa2, 0x76, 0x15, 0x93, 0x75, 0x8b, 0xa9, 0xfc, 0x53,
-	0x2d, 0x56, 0xd0, 0x1e, 0x4b, 0x86, 0x05, 0x68, 0x59, 0x43, 0x53, 0x79, 0x0a, 0xdd, 0x84, 0x5a,
-	0x80, 0x23, 0x52, 0xe3, 0x5f, 0xd2, 0xd9, 0xa3, 0x05, 0x9d, 0x80, 0xbc, 0x0b, 0xb7, 0x8c, 0xb2,
-	0x18, 0x14, 0x37, 0x11, 0x47, 0xb4, 0x2e, 0x1f, 0x11, 0x8a, 0x2e, 0xe6, 0x91, 0xab, 0x26, 0x4f,
-	0xac, 0x37, 0x70, 0x3a, 0xaa, 0x31, 0x8f, 0xd4, 0xa9, 0x52, 0x90, 0x3b, 0x00, 0xea, 0xa6, 0x10,
-	0xf1, 0x90, 0xf7, 0x5f, 0xa4, 0x05, 0x6d, 0x2c, 0x21, 0xdb, 0x7a, 0x4f, 0x65, 0x81, 0x3e, 0x17,
-	0x99, 0x04, 0x03, 0x5c, 0x40, 0x3c, 0xe6, 0x90, 0x2d, 0x00, 0x83, 0xa0, 0xe6, 0x74, 0x60, 0x39,
-	0x55, 0xd4, 0xef, 0x45, 0x01, 0xb9, 0x0b, 0x2d, 0x2f, 0x0c, 0xb9, 0x3f, 0x66, 0xa8, 0x22, 0xa2,
-	0x81, 0xd2, 0x94, 0x63, 0x1b, 0x1a, 0x19, 0x8a, 0x9a, 0x9d, 0xdb, 0x72, 0xc0, 0x60, 0x14, 0xcf,
-	0x3d, 0x58, 0x1a, 0x87, 0x84, 0x61, 0x02, 0x44, 0xb5, 0xb2, 0xc0, 0xd0, 0x5c, 0x77, 0xa1, 0x95,
-	0x43, 0x52, 0xb3, 0x91, 0x5a, 0x4e, 0x23, 0xc3, 0x29, 0x3e, 0x1b, 0x9a, 0xa6, 0x98, 0x18, 0xb2,
-	0x26, 0x82, 0xea, 0xba, 0xa4, 0x68, 0xa6, 0x3b, 0x50, 0x4f, 0x31, 0x8a, 0xa6, 0xa5, 0xe3, 0x50,
-	0x23, 0x14, 0xc7, 0xc7, 0x50, 0x49, 0xbc, 0xa8, 0x4f, 0xc5, 0xfa, 0xe2, 0xf6, 0xfc, 0xbd, 0xfa,
-	0xc3, 0x7b, 0xe3, 0x13, 0x6b, 0x16, 0x50, 0xe6, 0xd3, 0xa1, 0x82, 0x8f, 0x12, 0x9f, 0x3a, 0x88,
-	0x77, 0x8c, 0xdd, 0xc6, 0xaf, 0xcb, 0x70, 0x6b, 0x16, 0x80, 0xdc, 0x4e, 0x2f, 0x5a, 0x81, 0x58,
-	0x2f, 0x6d, 0xcf, 0xdf, 0xb3, 0xcc, 0x6d, 0x2a, 0x98, 0x5c, 0xb1, 0xb9, 0xa9, 0x15, 0xdb, 0x85,
-	0x85, 0x98, 0xf3, 0x50, 0xac, 0xcf, 0xe3, 0xa0, 0xde, 0x79, 0xd5, 0x41, 0xdd, 0x3f, 0xe4, 0x3c,
-	0x74, 0xb4, 0xed, 0xc6, 0xdf, 0xe7, 0xa0, 0xac, 0xda, 0xe4, 0xfb, 0xb9, 0xed, 0xa7, 0xf5, 0xf0,
-	0xff, 0xae, 0x45, 0x86, 0x7f, 0x54, 0xc9, 0x37, 0xdb, 0xd6, 0x11, 0x58, 0x62, 0xe0, 0x25, 0x2c,
-	0xea, 0xe3, 0xb0, 0x5b, 0x0f, 0x3f, 0xbc, 0x1e, 0xdd, 0x91, 0x36, 0x46, 0xc6, 0x94, 0x49, 0x25,
-	0xa6, 0x5e, 0x40, 0xbd, 0x27, 0xe8, 0x86, 0xca, 0x73, 0x6a, 0x8e, 0xee, 0x96, 0xa3, 0x3e, 0xed,
-	0x1d, 0xa8, 0xa6, 0xc3, 0x21, 0x00, 0x95, 0xee, 0xd3, 0x67, 0x6e, 0xa7, 0xbd, 0x74, 0x83, 0x34,
-	0xa0, 0xba, 0xf3, 0xe4, 0x49, 0x77, 0x57, 0xb5, 0x4a, 0xa4, 0x05, 0xf0, 0xc9, 0xde, 0xc1, 0x61,
-	0xd7, 0x39, 0x56, 0xed, 0x39, 0x52, 0x07, 0xeb, 0xf1, 0x93, 0xee, 0x73, 0xd5, 0x98, 0xb7, 0x07,
-	0x50, 0xcf, 0x0d, 0x81, 0xac, 0x02, 0x69, 0xef, 0xb5, 0x3b, 0xbb, 0x3b, 0xc7, 0x7b, 0x6d, 0xf7,
-	0x70, 0xcf, 0x71, 0x3b, 0x4f, 0x8f, 0x1f, 0x2f, 0xdd, 0x20, 0x6f, 0xc2, 0xe6, 0xd1, 0xfe, 0x8e,
-	0xb3, 0xd7, 0x76, 0x1f, 0xfd, 0xd8, 0xdd, 0x79, 0xf2, 0x04, 0xe5, 0xf8, 0x71, 0xbc, 0xb7, 0xbb,
-	0xbf, 0x54, 0x22, 0xdb, 0xb0, 0x35, 0x03, 0x70, 0xb4, 0x73, 0xb0, 0xa7, 0x11, 0x73, 0xf6, 0x2f,
-	0xe6, 0x01, 0x76, 0x43, 0x4f, 0x08, 0xd6, 0x63, 0x34, 0xc1, 0xfa, 0xe9, 0xca, 0x38, 0xab, 0x66,
-	0x0b, 0xfc, 0x38, 0x66, 0x01, 0x59, 0x86, 0x05, 0xee, 0x9e, 0x65, 0x55, 0xb5, 0xcc, 0x3f, 0x65,
-	0x58, 0x6b, 0x99, 0xc6, 0x9a, 0x09, 0x61, 0x29, 0x96, 0x21, 0x56, 0x4f, 0x49, 0x99, 0x29, 0xec,
-	0x1a, 0x58, 0xdc, 0x8d, 0x4f, 0x98, 0x14, 0xa6, 0xc8, 0x56, 0xf8, 0xa1, 0x6a, 0x61, 0xfd, 0x34,
-	0x0a, 0xb3, 0xa3, 0x32, 0xad, 0xb8, 0x0d, 0x55, 0x2a, 0x07, 0x7a, 0x5f, 0xd7, 0xa9, 0x6e, 0x51,
-	0x39, 0x48, 0xb7, 0xf5, 0x40, 0x48, 0x77, 0xe8, 0xf9, 0x98, 0xe2, 0x0d, 0xa7, 0x12, 0x08, 0x79,
-	0xe0, 0xf9, 0x4a, 0x21, 0x12, 0x1f, 0x15, 0x35, 0xad, 0x10, 0x89, 0xaf, 0x14, 0x2a, 0xc8, 0x63,
-	0xfd, 0x5e, 0x61, 0x72, 0xd9, 0x62, 0xf1, 0x21, 0xbe, 0x79, 0xac, 0x80, 0xb2, 0x76, 0x59, 0x6c,
-	0x92, 0x77, 0x21, 0x10, 0xb2, 0x13, 0x2b, 0xb1, 0xa2, 0x62, 0xb1, 0xa9, 0x63, 0x0b, 0x22, 0xf1,
-	0x3b, 0xb1, 0x22, 0x52, 0x62, 0x95, 0xdd, 0x26, 0x8f, 0x55, 0x8f, 0xaa, 0xc0, 0x29, 0x95, 0x22,
-	0x42, 0x95, 0x4e, 0x60, 0x35, 0x4a, 0x54, 0x6d, 0x43, 0x43, 0x5d, 0xd5, 0xa5, 0xd7, 0xd7, 0xfe,
-	0x2c, 0xea, 0x54, 0x8a, 0x4f, 0xe5, 0xb1, 0x87, 0x2b, 0x6c, 0xff, 0x0c, 0x6a, 0xea, 0xc8, 0xce,
-	0xa3, 0xdd, 0x21, 0x56, 0x0c, 0x2f, 0x08, 0x5c, 0x3e, 0x92, 0x34, 0x51, 0x46, 0xb8, 0x16, 0x55,
-	0xa7, 0xee, 0x05, 0x41, 0x57, 0xc9, 0x8e, 0xbd, 0xbe, 0xaa, 0x52, 0x09, 0x1d, 0xf2, 0x33, 0x9a,
-	0x83, 0xcd, 0x21, 0xac, 0xa5, 0xe5, 0x19, 0x72, 0x1b, 0x1a, 0x32, 0xf1, 0x62, 0x57, 0x72, 0x77,
-	0xc0, 0x85, 0x8e, 0xde, 0xaa, 0x03, 0x4a, 0x76, 0xcc, 0xf7, 0xb9, 0x90, 0xf6, 0x1f, 0x4a, 0x50,
-	0xd1, 0xbd, 0x93, 0xbb, 0x30, 0xef, 0x0f, 0xd3, 0x1b, 0x35, 0x19, 0x5f, 0xd2, 0xd3, 0xb1, 0x39,
-	0x4a, 0x3d, 0x3b, 0x1c, 0x72, 0x4b, 0x3c, 0x5f, 0x58, 0xe2, 0x71, 0x4c, 0x95, 0x27, 0x62, 0x4a,
-	0xc7, 0xc9, 0x42, 0x31, 0x4e, 0x66, 0x87, 0xc3, 0x38, 0xd8, 0xac, 0x5c, 0xb0, 0xd9, 0xbf, 0x9b,
-	0x87, 0xf2, 0xe3, 0x90, 0x9f, 0x63, 0xf5, 0xf7, 0xd5, 0x8d, 0xc4, 0xcd, 0x6f, 0xc7, 0x8b, 0x4e,
-	0x43, 0x4b, 0x3b, 0xb3, 0x8e, 0x07, 0x8b, 0xe9, 0xf1, 0x60, 0x05, 0x2a, 0xa3, 0x88, 0x29, 0x71,
-	0x5d, 0x8b, 0x47, 0x11, 0xbb, 0xea, 0x18, 0xb8, 0x09, 0x58, 0x9b, 0xf5, 0x62, 0xea, 0xad, 0xb5,
-	0xaa, 0x04, 0x18, 0x9d, 0xb7, 0xa1, 0x9a, 0xee, 0x30, 0x18, 0x6b, 0x8b, 0x8e, 0x65, 0x76, 0x17,
-	0xf2, 0x16, 0x2c, 0x46, 0x54, 0x9e, 0xf3, 0xe4, 0x34, 0x1b, 0xe5, 0x02, 0x22, 0x9a, 0x46, 0xdc,
-	0x99, 0x75, 0x3c, 0xad, 0x20, 0x24, 0x77, 0x2a, 0x79, 0x1f, 0xc0, 0xcf, 0x52, 0xd6, 0xdc, 0x92,
-	0x97, 0xb3, 0xb5, 0x1a, 0x67, 0xb3, 0x93, 0x83, 0x91, 0xb7, 0xa1, 0xe2, 0xe1, 0x2a, 0x9a, 0xdb,
-	0xef, 0xe2, 0xc4, 0xe2, 0x3a, 0x46, 0x4d, 0x36, 0xa0, 0x1a, 0x27, 0x8c, 0x27, 0x4c, 0xbe, 0xc0,
-	0x2c, 0x5a, 0x74, 0xb2, 0x76, 0xee, 0x98, 0xdb, 0x28, 0x1c, 0x73, 0x73, 0xe7, 0xab, 0x66, 0xfe,
-	0x7c, 0x65, 0x1f, 0x43, 0x63, 0xf2, 0x84, 0xa0, 0x8f, 0x39, 0xe9, 0x0a, 0x35, 0x9c, 0xaa, 0x16,
-	0x74, 0x02, 0xf2, 0x36, 0x2c, 0x1a, 0xa5, 0x88, 0xa9, 0xcf, 0x7a, 0xcc, 0x37, 0xc7, 0xa7, 0x96,
-	0x16, 0x1f, 0x19, 0xa9, 0xfd, 0xe7, 0x32, 0xb4, 0x8a, 0x4f, 0x55, 0x97, 0x9f, 0xc3, 0x6e, 0x43,
-	0x35, 0xb9, 0x70, 0x4f, 0x5e, 0x48, 0x2a, 0x90, 0xad, 0xe2, 0x58, 0xc9, 0xc5, 0x23, 0xd5, 0x54,
-	0xd3, 0x9c, 0x5c, 0xb8, 0x31, 0x1e, 0xe4, 0x74, 0xd0, 0x56, 0x9c, 0x5a, 0x72, 0xa1, 0x4f, 0x76,
-	0x02, 0x53, 0xec, 0xc2, 0x1d, 0xf9, 0x9e, 0xca, 0x6a, 0x03, 0x2a, 0x23, 0xa8, 0x95, 0x5c, 0x3c,
-	0x53, 0xe2, 0x22, 0x72, 0x58, 0x40, 0x2e, 0xa4, 0xc8, 0x83, 0x69, 0xe4, 0x49, 0x01, 0x59, 0x49,
-	0x91, 0x8f, 0xa6, 0x91, 0xfa, 0x8e, 0x9e, 0x22, 0xad, 0x14, 0x89, 0x77, 0xee, 0x14, 0x79, 0x1b,
-	0xaa, 0x32, 0xf5, 0xb0, 0xaa, 0x3d, 0x94, 0x63, 0x0f, 0xe5, 0xd8, 0xc3, 0x9a, 0xf6, 0x50, 0xe6,
-	0x3d, 0x94, 0x93, 0x1e, 0x82, 0xee, 0x43, 0x4e, 0x79, 0x28, 0x27, 0x3d, 0xac, 0xa7, 0xc8, 0x83,
-	0x69, 0x64, 0xd1, 0xc3, 0x46, 0x8a, 0x7c, 0x34, 0x8d, 0x2c, 0x7a, 0xd8, 0x4c, 0x91, 0x05, 0x0f,
-	0x6d, 0x68, 0x26, 0x17, 0xae, 0x9f, 0xf8, 0x1a, 0x2d, 0xb0, 0xbe, 0x56, 0x9c, 0x7a, 0x72, 0xb1,
-	0x9b, 0xf8, 0x88, 0x44, 0x57, 0x4f, 0x58, 0x9c, 0x02, 0x16, 0xb5, 0xab, 0x27, 0x2c, 0x36, 0xea,
-	0x2d, 0xa8, 0x49, 0x36, 0xa4, 0x42, 0x7a, 0xc3, 0x18, 0x4f, 0xba, 0x96, 0x33, 0x16, 0xa8, 0xeb,
-	0x7c, 0xab, 0xf8, 0x82, 0x99, 0x4f, 0xfe, 0x52, 0x21, 0xf9, 0xbf, 0x79, 0x40, 0x7d, 0xf3, 0x85,
-	0xba, 0x7a, 0xf4, 0x1f, 0x43, 0xb3, 0xf0, 0xe4, 0x79, 0x79, 0x32, 0xac, 0x42, 0x45, 0x5d, 0xd8,
-	0x47, 0xc2, 0x9c, 0xe6, 0x4c, 0xcb, 0xfe, 0x29, 0x2c, 0xcf, 0x78, 0xfa, 0xbc, 0xf6, 0x35, 0x6b,
-	0x4c, 0x3f, 0x5f, 0xa0, 0xff, 0x6b, 0x09, 0xc8, 0xf4, 0xab, 0xe8, 0x37, 0x79, 0x32, 0x09, 0xb9,
-	0x70, 0x0b, 0x5d, 0xd4, 0x42, 0x2e, 0x8e, 0x50, 0xa0, 0xd5, 0x27, 0xa9, 0xba, 0x9c, 0xaa, 0x4f,
-	0x8c, 0xfa, 0x1e, 0x2c, 0x85, 0x3c, 0xf6, 0xdd, 0x21, 0x13, 0x19, 0x87, 0xbe, 0x85, 0xb4, 0x94,
-	0xfc, 0x80, 0x89, 0x94, 0xe8, 0x3d, 0x58, 0x31, 0x48, 0x13, 0x70, 0x29, 0xbc, 0xa2, 0x6f, 0x3e,
-	0x1a, 0xae, 0x03, 0x4f, 0x9b, 0xd8, 0x14, 0x36, 0xaf, 0x78, 0xac, 0x7d, 0x6d, 0x13, 0xf9, 0x9b,
-	0x12, 0x6c, 0x5c, 0xfe, 0x72, 0xfb, 0xba, 0xba, 0x21, 0xef, 0xc3, 0x2a, 0x8b, 0xd4, 0xd5, 0x91,
-	0xba, 0x27, 0x4c, 0x9a, 0x39, 0x48, 0x3c, 0x49, 0xcd, 0x0e, 0xbe, 0x6c, 0xb4, 0x8f, 0x98, 0xc4,
-	0x49, 0x70, 0x3c, 0x49, 0xed, 0xaf, 0xf4, 0xd8, 0x2e, 0x79, 0xf8, 0x7d, 0x6d, 0x63, 0xbb, 0x05,
-	0x0b, 0xf8, 0x04, 0x9d, 0x1e, 0x26, 0xb0, 0xa1, 0xd8, 0x23, 0x7a, 0xee, 0xd2, 0x2f, 0xd2, 0xe3,
-	0x44, 0x25, 0xa2, 0xe7, 0x7b, 0x5f, 0x04, 0xf6, 0x00, 0xee, 0x5c, 0xfd, 0x6c, 0xfc, 0xda, 0xd6,
-	0xe6, 0xb7, 0x25, 0x1d, 0x03, 0x97, 0x3c, 0x24, 0xff, 0x7b, 0x17, 0xe7, 0xcb, 0x12, 0xd8, 0x2f,
-	0x7f, 0x94, 0xfe, 0xd7, 0x2e, 0x92, 0x7d, 0x88, 0x6b, 0x71, 0xc5, 0xe3, 0xf5, 0x75, 0xfb, 0xb7,
-	0x9f, 0xc2, 0xd6, 0x55, 0x6f, 0xd5, 0xd7, 0xe6, 0xb3, 0x60, 0x61, 0x6f, 0x18, 0xcb, 0x17, 0x0f,
-	0xbf, 0x6e, 0x82, 0xd5, 0xd5, 0xe7, 0x23, 0xd2, 0x06, 0x68, 0x33, 0xe1, 0x9d, 0x84, 0xb4, 0x1b,
-	0x4a, 0xd2, 0xca, 0xce, 0x4d, 0x88, 0xdc, 0x98, 0x68, 0xdb, 0xab, 0x5f, 0xfe, 0xe5, 0x6f, 0x5f,
-	0xcd, 0x2d, 0xd9, 0xf5, 0x07, 0x67, 0xef, 0x3d, 0x30, 0x76, 0x1f, 0x95, 0xfe, 0x9b, 0x3c, 0x86,
-	0xba, 0x43, 0x69, 0xf4, 0xaa, 0x34, 0x6b, 0x48, 0x73, 0xd3, 0x6e, 0x28, 0x9a, 0xd4, 0x50, 0xf1,
-	0xec, 0x41, 0xdd, 0xcc, 0x20, 0xed, 0x46, 0x23, 0xd2, 0xc8, 0x3f, 0xda, 0x4f, 0xb1, 0xac, 0x23,
-	0x0b, 0xb1, 0x9b, 0x8a, 0x65, 0x4f, 0x77, 0x1e, 0x8d, 0x14, 0xcd, 0x3e, 0x34, 0xdb, 0xd4, 0x7b,
-	0x65, 0xa2, 0xdb, 0x48, 0xb4, 0x6c, 0xb7, 0x72, 0x5e, 0x19, 0xa6, 0x5d, 0xa8, 0xb5, 0x69, 0x48,
-	0xaf, 0x3d, 0x9c, 0xcc, 0x48, 0x91, 0x74, 0x00, 0xcc, 0x5b, 0x61, 0x77, 0x24, 0xc9, 0x52, 0xe1,
-	0xdf, 0x9f, 0x07, 0xa2, 0x7f, 0xf5, 0x78, 0xc6, 0x96, 0x8a, 0xaa, 0x0b, 0x8d, 0xec, 0xa1, 0x50,
-	0x91, 0x91, 0xc2, 0xbf, 0x35, 0x50, 0x3c, 0x45, 0xb7, 0x89, 0x74, 0x2b, 0xf6, 0x12, 0xd2, 0xe5,
-	0xac, 0x15, 0xe1, 0x8f, 0x60, 0x31, 0xff, 0xe4, 0xa7, 0x38, 0xc7, 0x2f, 0xa2, 0x79, 0xcd, 0x14,
-	0xed, 0x1d, 0xa4, 0x5d, 0xb7, 0x97, 0x15, 0xed, 0x04, 0x87, 0x62, 0xfe, 0x18, 0x2c, 0x75, 0xea,
-	0xd8, 0x09, 0x02, 0xd2, 0x2c, 0xfc, 0x27, 0xf5, 0xea, 0xa8, 0x32, 0x36, 0x3a, 0xaa, 0x40, 0xb5,
-	0x1c, 0xbc, 0xf2, 0xbd, 0x8c, 0xa4, 0x30, 0x69, 0x63, 0x33, 0xc5, 0x73, 0x04, 0xad, 0xec, 0xbd,
-	0x79, 0x77, 0x40, 0xfd, 0xd3, 0xa9, 0x00, 0x1d, 0x4f, 0x63, 0x06, 0xb4, 0xdf, 0x40, 0xc2, 0x35,
-	0x9b, 0x28, 0xc2, 0xa2, 0xbd, 0x22, 0x3d, 0x80, 0xba, 0x8e, 0xb9, 0x43, 0x1e, 0x75, 0x7a, 0xb9,
-	0x85, 0xc8, 0x1e, 0xc0, 0xa7, 0x86, 0xb8, 0x81, 0x8c, 0xb7, 0xec, 0xc5, 0x71, 0xc0, 0xa2, 0xb1,
-	0x59, 0x58, 0x13, 0x79, 0xaf, 0xce, 0x57, 0x58, 0xd8, 0xbc, 0xb5, 0x22, 0x74, 0xa0, 0xf9, 0x09,
-	0x95, 0xb9, 0x27, 0xd9, 0x49, 0x9f, 0x97, 0x67, 0xbc, 0x1a, 0xd9, 0x5b, 0x48, 0xb9, 0x6a, 0xdf,
-	0x54, 0x94, 0x05, 0x7b, 0xc5, 0xf9, 0x3d, 0xa8, 0x38, 0xf4, 0x84, 0xf3, 0x97, 0x67, 0xf8, 0x0a,
-	0xf2, 0x2c, 0xda, 0xa0, 0x33, 0x5c, 0xd9, 0x28, 0x82, 0x67, 0x70, 0x73, 0x97, 0x87, 0x21, 0xf5,
-	0xf3, 0xb7, 0x9b, 0x97, 0x71, 0x6d, 0x23, 0xd7, 0x86, 0xbd, 0xa2, 0xb8, 0xa6, 0xcc, 0x15, 0x6d,
-	0x02, 0x6b, 0xbb, 0x09, 0xf5, 0x24, 0x3d, 0x4e, 0xbc, 0x5e, 0x8f, 0xf9, 0x47, 0xfe, 0x80, 0x06,
-	0xa3, 0x90, 0x26, 0x82, 0xbc, 0x79, 0xbf, 0xf0, 0x0b, 0x8e, 0x29, 0xc0, 0x54, 0x6f, 0x6f, 0x61,
-	0x6f, 0xdb, 0xf6, 0x26, 0xf6, 0x36, 0x9b, 0xd5, 0xf4, 0xa9, 0x23, 0xec, 0x75, 0xf7, 0x79, 0x09,
-	0xab, 0xea, 0xb3, 0x07, 0xcb, 0x85, 0x11, 0xfd, 0x70, 0x44, 0x47, 0x54, 0x90, 0xcd, 0x99, 0xfd,
-	0x69, 0xe5, 0x54, 0x5f, 0x36, 0xf6, 0xb5, 0x65, 0xaf, 0x4d, 0xf9, 0xa7, 0x0d, 0x4c, 0x3f, 0x85,
-	0x51, 0xfc, 0xd3, 0xfd, 0xcc, 0x60, 0x53, 0xfd, 0x7c, 0x1b, 0x96, 0x74, 0x1a, 0xe4, 0x76, 0xb5,
-	0xcb, 0xc3, 0x74, 0x0c, 0xb2, 0x6f, 0xbc, 0x5b, 0x7a, 0x74, 0xff, 0xb3, 0xff, 0xed, 0x33, 0x39,
-	0x18, 0x9d, 0xdc, 0xf7, 0xf9, 0x10, 0x7f, 0xeb, 0xe3, 0xf3, 0x24, 0x78, 0xa0, 0x7f, 0xbe, 0xf3,
-	0x8e, 0xf9, 0xf9, 0x4e, 0x9f, 0xa7, 0xbf, 0x02, 0x3a, 0x2c, 0x9d, 0x54, 0x50, 0xf8, 0xfe, 0x3f,
-	0x02, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xbc, 0x2c, 0xb8, 0x27, 0x24, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// 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)
-	FlowRemove(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)
-	GetDeviceInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceInfo, error)
-	Reboot(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
-	CollectStatistics(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
-	CreateTrafficSchedulers(ctx context.Context, in *tech_profile.TrafficSchedulers, opts ...grpc.CallOption) (*Empty, error)
-	RemoveTrafficSchedulers(ctx context.Context, in *tech_profile.TrafficSchedulers, opts ...grpc.CallOption) (*Empty, error)
-	CreateTrafficQueues(ctx context.Context, in *tech_profile.TrafficQueues, opts ...grpc.CallOption) (*Empty, error)
-	RemoveTrafficQueues(ctx context.Context, in *tech_profile.TrafficQueues, 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) FlowRemove(ctx context.Context, in *Flow, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/FlowRemove", 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) GetDeviceInfo(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*DeviceInfo, error) {
-	out := new(DeviceInfo)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/GetDeviceInfo", 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) CollectStatistics(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/CollectStatistics", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *openoltClient) CreateTrafficSchedulers(ctx context.Context, in *tech_profile.TrafficSchedulers, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/CreateTrafficSchedulers", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *openoltClient) RemoveTrafficSchedulers(ctx context.Context, in *tech_profile.TrafficSchedulers, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/RemoveTrafficSchedulers", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *openoltClient) CreateTrafficQueues(ctx context.Context, in *tech_profile.TrafficQueues, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/CreateTrafficQueues", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-func (c *openoltClient) RemoveTrafficQueues(ctx context.Context, in *tech_profile.TrafficQueues, opts ...grpc.CallOption) (*Empty, error) {
-	out := new(Empty)
-	err := c.cc.Invoke(ctx, "/openolt.Openolt/RemoveTrafficQueues", 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
-}
-
-// OpenoltServer is the 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)
-	FlowRemove(context.Context, *Flow) (*Empty, error)
-	HeartbeatCheck(context.Context, *Empty) (*Heartbeat, error)
-	EnablePonIf(context.Context, *Interface) (*Empty, error)
-	DisablePonIf(context.Context, *Interface) (*Empty, error)
-	GetDeviceInfo(context.Context, *Empty) (*DeviceInfo, error)
-	Reboot(context.Context, *Empty) (*Empty, error)
-	CollectStatistics(context.Context, *Empty) (*Empty, error)
-	CreateTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*Empty, error)
-	RemoveTrafficSchedulers(context.Context, *tech_profile.TrafficSchedulers) (*Empty, error)
-	CreateTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*Empty, error)
-	RemoveTrafficQueues(context.Context, *tech_profile.TrafficQueues) (*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_FlowRemove_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).FlowRemove(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/FlowRemove",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).FlowRemove(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_GetDeviceInfo_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).GetDeviceInfo(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/GetDeviceInfo",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).GetDeviceInfo(ctx, req.(*Empty))
-	}
-	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_CollectStatistics_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).CollectStatistics(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/CollectStatistics",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).CollectStatistics(ctx, req.(*Empty))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Openolt_CreateTrafficSchedulers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(tech_profile.TrafficSchedulers)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(OpenoltServer).CreateTrafficSchedulers(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/CreateTrafficSchedulers",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).CreateTrafficSchedulers(ctx, req.(*tech_profile.TrafficSchedulers))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Openolt_RemoveTrafficSchedulers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(tech_profile.TrafficSchedulers)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(OpenoltServer).RemoveTrafficSchedulers(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/RemoveTrafficSchedulers",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).RemoveTrafficSchedulers(ctx, req.(*tech_profile.TrafficSchedulers))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Openolt_CreateTrafficQueues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(tech_profile.TrafficQueues)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(OpenoltServer).CreateTrafficQueues(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/CreateTrafficQueues",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).CreateTrafficQueues(ctx, req.(*tech_profile.TrafficQueues))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Openolt_RemoveTrafficQueues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(tech_profile.TrafficQueues)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(OpenoltServer).RemoveTrafficQueues(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/openolt.Openolt/RemoveTrafficQueues",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(OpenoltServer).RemoveTrafficQueues(ctx, req.(*tech_profile.TrafficQueues))
-	}
-	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: "FlowRemove",
-			Handler:    _Openolt_FlowRemove_Handler,
-		},
-		{
-			MethodName: "HeartbeatCheck",
-			Handler:    _Openolt_HeartbeatCheck_Handler,
-		},
-		{
-			MethodName: "EnablePonIf",
-			Handler:    _Openolt_EnablePonIf_Handler,
-		},
-		{
-			MethodName: "DisablePonIf",
-			Handler:    _Openolt_DisablePonIf_Handler,
-		},
-		{
-			MethodName: "GetDeviceInfo",
-			Handler:    _Openolt_GetDeviceInfo_Handler,
-		},
-		{
-			MethodName: "Reboot",
-			Handler:    _Openolt_Reboot_Handler,
-		},
-		{
-			MethodName: "CollectStatistics",
-			Handler:    _Openolt_CollectStatistics_Handler,
-		},
-		{
-			MethodName: "CreateTrafficSchedulers",
-			Handler:    _Openolt_CreateTrafficSchedulers_Handler,
-		},
-		{
-			MethodName: "RemoveTrafficSchedulers",
-			Handler:    _Openolt_RemoveTrafficSchedulers_Handler,
-		},
-		{
-			MethodName: "CreateTrafficQueues",
-			Handler:    _Openolt_CreateTrafficQueues_Handler,
-		},
-		{
-			MethodName: "RemoveTrafficQueues",
-			Handler:    _Openolt_RemoveTrafficQueues_Handler,
-		},
-	},
-	Streams: []grpc.StreamDesc{
-		{
-			StreamName:    "EnableIndication",
-			Handler:       _Openolt_EnableIndication_Handler,
-			ServerStreams: true,
-		},
-	},
-	Metadata: "voltha_protos/openolt.proto",
-}
diff --git a/vendor/github.com/opencord/voltha-protos/go/schema/schema.pb.go b/vendor/github.com/opencord/voltha-protos/go/schema/schema.pb.go
deleted file mode 100644
index 6149951..0000000
--- a/vendor/github.com/opencord/voltha-protos/go/schema/schema.pb.go
+++ /dev/null
@@ -1,245 +0,0 @@
-// Code generated by protoc-gen-go. DO NOT EDIT.
-// source: voltha_protos/schema.proto
-
-package schema
-
-import (
-	context "context"
-	fmt "fmt"
-	proto "github.com/golang/protobuf/proto"
-	empty "github.com/golang/protobuf/ptypes/empty"
-	_ "google.golang.org/genproto/googleapis/api/annotations"
-	grpc "google.golang.org/grpc"
-	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
-
-// Contains the name and content of a *.proto file
-type ProtoFile struct {
-	FileName             string   `protobuf:"bytes,1,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"`
-	Proto                string   `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"`
-	Descriptor_          []byte   `protobuf:"bytes,3,opt,name=descriptor,proto3" json:"descriptor,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *ProtoFile) Reset()         { *m = ProtoFile{} }
-func (m *ProtoFile) String() string { return proto.CompactTextString(m) }
-func (*ProtoFile) ProtoMessage()    {}
-func (*ProtoFile) Descriptor() ([]byte, []int) {
-	return fileDescriptor_9d785a7d5fd3f7a9, []int{0}
-}
-
-func (m *ProtoFile) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_ProtoFile.Unmarshal(m, b)
-}
-func (m *ProtoFile) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_ProtoFile.Marshal(b, m, deterministic)
-}
-func (m *ProtoFile) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_ProtoFile.Merge(m, src)
-}
-func (m *ProtoFile) XXX_Size() int {
-	return xxx_messageInfo_ProtoFile.Size(m)
-}
-func (m *ProtoFile) XXX_DiscardUnknown() {
-	xxx_messageInfo_ProtoFile.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_ProtoFile proto.InternalMessageInfo
-
-func (m *ProtoFile) GetFileName() string {
-	if m != nil {
-		return m.FileName
-	}
-	return ""
-}
-
-func (m *ProtoFile) GetProto() string {
-	if m != nil {
-		return m.Proto
-	}
-	return ""
-}
-
-func (m *ProtoFile) GetDescriptor_() []byte {
-	if m != nil {
-		return m.Descriptor_
-	}
-	return nil
-}
-
-// Proto files and compiled descriptors for this interface
-type Schemas struct {
-	// Proto files
-	Protos []*ProtoFile `protobuf:"bytes,1,rep,name=protos,proto3" json:"protos,omitempty"`
-	// Proto file name from which swagger.json shall be generated
-	SwaggerFrom string `protobuf:"bytes,2,opt,name=swagger_from,json=swaggerFrom,proto3" json:"swagger_from,omitempty"`
-	// Proto file name from which yang schemas shall be generated
-	YangFrom             string   `protobuf:"bytes,3,opt,name=yang_from,json=yangFrom,proto3" json:"yang_from,omitempty"`
-	XXX_NoUnkeyedLiteral struct{} `json:"-"`
-	XXX_unrecognized     []byte   `json:"-"`
-	XXX_sizecache        int32    `json:"-"`
-}
-
-func (m *Schemas) Reset()         { *m = Schemas{} }
-func (m *Schemas) String() string { return proto.CompactTextString(m) }
-func (*Schemas) ProtoMessage()    {}
-func (*Schemas) Descriptor() ([]byte, []int) {
-	return fileDescriptor_9d785a7d5fd3f7a9, []int{1}
-}
-
-func (m *Schemas) XXX_Unmarshal(b []byte) error {
-	return xxx_messageInfo_Schemas.Unmarshal(m, b)
-}
-func (m *Schemas) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
-	return xxx_messageInfo_Schemas.Marshal(b, m, deterministic)
-}
-func (m *Schemas) XXX_Merge(src proto.Message) {
-	xxx_messageInfo_Schemas.Merge(m, src)
-}
-func (m *Schemas) XXX_Size() int {
-	return xxx_messageInfo_Schemas.Size(m)
-}
-func (m *Schemas) XXX_DiscardUnknown() {
-	xxx_messageInfo_Schemas.DiscardUnknown(m)
-}
-
-var xxx_messageInfo_Schemas proto.InternalMessageInfo
-
-func (m *Schemas) GetProtos() []*ProtoFile {
-	if m != nil {
-		return m.Protos
-	}
-	return nil
-}
-
-func (m *Schemas) GetSwaggerFrom() string {
-	if m != nil {
-		return m.SwaggerFrom
-	}
-	return ""
-}
-
-func (m *Schemas) GetYangFrom() string {
-	if m != nil {
-		return m.YangFrom
-	}
-	return ""
-}
-
-func init() {
-	proto.RegisterType((*ProtoFile)(nil), "schema.ProtoFile")
-	proto.RegisterType((*Schemas)(nil), "schema.Schemas")
-}
-
-func init() { proto.RegisterFile("voltha_protos/schema.proto", fileDescriptor_9d785a7d5fd3f7a9) }
-
-var fileDescriptor_9d785a7d5fd3f7a9 = []byte{
-	// 316 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x4c, 0x51, 0xc1, 0x4a, 0xeb, 0x40,
-	0x14, 0x25, 0x2d, 0xaf, 0x7d, 0x99, 0x56, 0x8a, 0x83, 0x48, 0x48, 0x45, 0x6a, 0x57, 0x15, 0x69,
-	0x02, 0xf5, 0x0f, 0x84, 0xd6, 0x9d, 0x48, 0x0b, 0x2e, 0x5c, 0x58, 0xa6, 0xe9, 0xed, 0x64, 0x20,
-	0x93, 0x1b, 0x26, 0xd3, 0x4a, 0xb7, 0xfe, 0x82, 0x9f, 0xe6, 0x2f, 0xf8, 0x21, 0x32, 0xb9, 0x53,
-	0x71, 0x37, 0xe7, 0x9c, 0x3b, 0xdc, 0x73, 0xce, 0x65, 0xf1, 0x01, 0x0b, 0x9b, 0x8b, 0x75, 0x65,
-	0xd0, 0x62, 0x9d, 0xd6, 0x59, 0x0e, 0x5a, 0x24, 0x0d, 0xe2, 0x1d, 0x42, 0xf1, 0x95, 0x44, 0x94,
-	0x05, 0xa4, 0xa2, 0x52, 0xa9, 0x28, 0x4b, 0xb4, 0xc2, 0x2a, 0x2c, 0x6b, 0x9a, 0x8a, 0x87, 0x5e,
-	0x6d, 0xd0, 0x66, 0xbf, 0x4b, 0x41, 0x57, 0xf6, 0x48, 0xe2, 0xf8, 0x8d, 0x85, 0xcf, 0xee, 0xb1,
-	0x50, 0x05, 0xf0, 0x21, 0x0b, 0x77, 0xaa, 0x80, 0x75, 0x29, 0x34, 0x44, 0xc1, 0x28, 0x98, 0x84,
-	0xcb, 0xff, 0x8e, 0x78, 0x12, 0x1a, 0xf8, 0x05, 0xfb, 0xd7, 0x7c, 0x89, 0x5a, 0x8d, 0x40, 0x80,
-	0x5f, 0x33, 0xb6, 0x85, 0x3a, 0x33, 0xaa, 0xb2, 0x68, 0xa2, 0xf6, 0x28, 0x98, 0xf4, 0x97, 0x7f,
-	0x98, 0xb1, 0x65, 0xdd, 0x55, 0x63, 0xb2, 0xe6, 0xb7, 0xac, 0x43, 0x21, 0xa2, 0x60, 0xd4, 0x9e,
-	0xf4, 0x66, 0xe7, 0x89, 0x0f, 0xf3, 0x6b, 0x60, 0xe9, 0x07, 0xf8, 0x0d, 0xeb, 0xd7, 0xef, 0x42,
-	0x4a, 0x30, 0xeb, 0x9d, 0x41, 0xed, 0x57, 0xf6, 0x3c, 0xb7, 0x30, 0xa8, 0x9d, 0xd7, 0xa3, 0x28,
-	0x25, 0xe9, 0x6d, 0xf2, 0xea, 0x08, 0x27, 0xce, 0x5e, 0xd8, 0x19, 0x6d, 0x5d, 0x81, 0x39, 0xa8,
-	0x0c, 0xf8, 0x9c, 0x85, 0x8f, 0x60, 0x89, 0xe3, 0x97, 0x09, 0x35, 0x92, 0x9c, 0x1a, 0x49, 0xe6,
-	0xae, 0x91, 0x78, 0x70, 0x32, 0xe4, 0x1d, 0x8f, 0x07, 0x1f, 0x5f, 0xdf, 0x9f, 0xad, 0x90, 0x77,
-	0x7d, 0xed, 0x0f, 0xd3, 0xd7, 0x3b, 0xa9, 0x6c, 0xbe, 0xdf, 0x24, 0x19, 0xea, 0x14, 0x2b, 0x28,
-	0x33, 0x34, 0xdb, 0x94, 0x4e, 0x34, 0xf5, 0x27, 0x92, 0xe8, 0xc7, 0x37, 0x14, 0xe7, 0xfe, 0x27,
-	0x00, 0x00, 0xff, 0xff, 0xdc, 0x3c, 0x6a, 0x7d, 0xc4, 0x01, 0x00, 0x00,
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConn
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion4
-
-// SchemaServiceClient is the client API for SchemaService service.
-//
-// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type SchemaServiceClient interface {
-	// Return active grpc schemas
-	GetSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Schemas, error)
-}
-
-type schemaServiceClient struct {
-	cc *grpc.ClientConn
-}
-
-func NewSchemaServiceClient(cc *grpc.ClientConn) SchemaServiceClient {
-	return &schemaServiceClient{cc}
-}
-
-func (c *schemaServiceClient) GetSchema(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Schemas, error) {
-	out := new(Schemas)
-	err := c.cc.Invoke(ctx, "/schema.SchemaService/GetSchema", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// SchemaServiceServer is the server API for SchemaService service.
-type SchemaServiceServer interface {
-	// Return active grpc schemas
-	GetSchema(context.Context, *empty.Empty) (*Schemas, error)
-}
-
-func RegisterSchemaServiceServer(s *grpc.Server, srv SchemaServiceServer) {
-	s.RegisterService(&_SchemaService_serviceDesc, srv)
-}
-
-func _SchemaService_GetSchema_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(empty.Empty)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(SchemaServiceServer).GetSchema(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/schema.SchemaService/GetSchema",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(SchemaServiceServer).GetSchema(ctx, req.(*empty.Empty))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _SchemaService_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "schema.SchemaService",
-	HandlerType: (*SchemaServiceServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "GetSchema",
-			Handler:    _SchemaService_GetSchema_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "voltha_protos/schema.proto",
-}
diff --git a/vendor/github.com/opencord/voltha-protos/go/tech_profile/tech_profile.pb.go b/vendor/github.com/opencord/voltha-protos/go/tech_profile/tech_profile.pb.go
deleted file mode 100644
index 4c6d4b3..0000000
--- a/vendor/github.com/opencord/voltha-protos/go/tech_profile/tech_profile.pb.go
+++ /dev/null
@@ -1,971 +0,0 @@
-// 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"`
-	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
-}
-
-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"`
-	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 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")
-}
-
-func init() { proto.RegisterFile("voltha_protos/tech_profile.proto", fileDescriptor_d019a68bffe14cae) }
-
-var fileDescriptor_d019a68bffe14cae = []byte{
-	// 1103 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x6e, 0x1b, 0x45,
-	0x14, 0xf6, 0xda, 0x8d, 0x7f, 0x4e, 0x6c, 0x77, 0x33, 0x25, 0xd4, 0xa4, 0x0d, 0x04, 0x97, 0xaa,
-	0x91, 0x11, 0x09, 0xa4, 0xd0, 0x9b, 0x22, 0x55, 0x76, 0x13, 0x29, 0x96, 0x68, 0x9a, 0x4e, 0x82,
-	0x2c, 0x71, 0xc1, 0x6a, 0xbc, 0x33, 0xb6, 0x47, 0x5a, 0xcf, 0x2c, 0xb3, 0x63, 0x9c, 0xf4, 0x8a,
-	0x1b, 0xde, 0x82, 0x5b, 0x5e, 0x00, 0x6e, 0x10, 0x4f, 0xc4, 0x0b, 0x70, 0x8f, 0x66, 0x76, 0xd7,
-	0xf6, 0xda, 0x26, 0x85, 0x0a, 0xee, 0xe6, 0x7c, 0xfb, 0xcd, 0x99, 0xf3, 0xcd, 0xf9, 0xd9, 0x81,
-	0xbd, 0xef, 0x65, 0xa0, 0x47, 0xc4, 0x0b, 0x95, 0xd4, 0x32, 0x3a, 0xd4, 0xcc, 0x1f, 0x99, 0xf5,
-	0x80, 0x07, 0xec, 0xc0, 0x62, 0xa8, 0xba, 0x88, 0xed, 0xdc, 0x1f, 0x4a, 0x39, 0x0c, 0xd8, 0x21,
-	0x09, 0xf9, 0x21, 0x11, 0x42, 0x6a, 0xa2, 0xb9, 0x14, 0x51, 0xcc, 0x6d, 0xfe, 0x90, 0x87, 0xdb,
-	0x17, 0xfe, 0x88, 0xd1, 0x49, 0xc0, 0xd4, 0x73, 0x29, 0x06, 0x7c, 0x88, 0xbe, 0x80, 0x0a, 0xe5,
-	0x8a, 0xf9, 0x86, 0xd7, 0x70, 0xf6, 0x9c, 0xfd, 0xfa, 0xd1, 0xdd, 0x83, 0xcc, 0x39, 0xc7, 0xe9,
-	0x67, 0x3c, 0x67, 0xa2, 0x67, 0x50, 0x23, 0x94, 0x72, 0xb3, 0x26, 0x81, 0xd7, 0x9f, 0x36, 0xf2,
-	0x76, 0xeb, 0x4e, 0x76, 0x6b, 0x7b, 0x46, 0xe9, 0xf4, 0x70, 0x75, 0xbe, 0xa1, 0x33, 0x45, 0x3b,
-	0x50, 0x0e, 0x15, 0x97, 0x8a, 0xeb, 0xeb, 0x46, 0x61, 0xcf, 0xd9, 0x2f, 0xe1, 0x99, 0x8d, 0xde,
-	0x85, 0xe2, 0x94, 0xf1, 0xe1, 0x48, 0x37, 0x6e, 0xd9, 0x2f, 0x89, 0x85, 0xda, 0x50, 0x8d, 0x4c,
-	0xf8, 0x5e, 0x28, 0x03, 0xee, 0x5f, 0x37, 0x36, 0xec, 0x99, 0xef, 0x67, 0xcf, 0x4c, 0x04, 0x72,
-	0x31, 0x3c, 0xb7, 0x2c, 0xbc, 0x69, 0xf7, 0xc4, 0x46, 0xf3, 0x37, 0x07, 0xd0, 0xa5, 0x22, 0x83,
-	0x01, 0xf7, 0x2f, 0x46, 0x24, 0xe4, 0x62, 0xd8, 0x15, 0x03, 0x89, 0x5c, 0x28, 0xf8, 0x5c, 0x59,
-	0xfd, 0x25, 0x6c, 0x96, 0x16, 0xe9, 0x47, 0x56, 0x96, 0x41, 0xfa, 0x91, 0x41, 0x42, 0xae, 0x92,
-	0x60, 0xcd, 0xd2, 0x22, 0xfd, 0x28, 0x09, 0xd2, 0x2c, 0x0d, 0x32, 0xe4, 0xca, 0x06, 0x56, 0xc2,
-	0x66, 0x89, 0x4e, 0x01, 0x08, 0xa5, 0x5e, 0x7f, 0xea, 0x71, 0x41, 0x1b, 0x45, 0x1b, 0x71, 0x2b,
-	0x1b, 0x71, 0x57, 0x0c, 0x98, 0x52, 0x8c, 0xa6, 0xb7, 0xd5, 0xe9, 0x75, 0x05, 0xe5, 0xbe, 0x4d,
-	0x1d, 0x2e, 0x13, 0x4a, 0x3b, 0xd3, 0xae, 0xa0, 0xcd, 0x3f, 0x1d, 0x70, 0xd3, 0xd0, 0xd3, 0x24,
-	0xbe, 0x6d, 0xfa, 0xde, 0x83, 0x32, 0x09, 0x02, 0xe9, 0x7b, 0x9c, 0x26, 0x12, 0x4b, 0xd6, 0xee,
-	0x52, 0xf4, 0x14, 0x2a, 0x51, 0xea, 0xde, 0x8a, 0xdd, 0x3c, 0xda, 0x5d, 0x7b, 0xc3, 0x69, 0x09,
-	0xe1, 0x39, 0x1f, 0x61, 0x78, 0x47, 0xc7, 0x21, 0x7a, 0x51, 0x7c, 0xbd, 0x1e, 0x17, 0x03, 0x69,
-	0xaf, 0x68, 0xf3, 0x68, 0x2f, 0xeb, 0x67, 0x35, 0x0f, 0x18, 0xe9, 0x15, 0xac, 0xf9, 0xbb, 0x03,
-	0x5b, 0xcb, 0xba, 0x23, 0x74, 0x17, 0x4a, 0x5c, 0xe8, 0x81, 0x11, 0x10, 0x67, 0xad, 0x68, 0xcc,
-	0x2e, 0x45, 0xdb, 0x50, 0x94, 0x62, 0x32, 0x17, 0xb6, 0x21, 0xc5, 0x24, 0x86, 0x27, 0x82, 0x1b,
-	0x38, 0x4e, 0xd7, 0xc6, 0x44, 0xf0, 0x2e, 0x35, 0x6e, 0x42, 0xa9, 0xb4, 0x27, 0x64, 0x92, 0xb4,
-	0xa2, 0x31, 0xcf, 0x24, 0x3a, 0x81, 0xfa, 0x4c, 0x89, 0x39, 0x35, 0x6a, 0x14, 0xf6, 0x0a, 0xfb,
-	0x9b, 0xcb, 0xd5, 0xb6, 0x1c, 0x18, 0xae, 0xe9, 0x05, 0x24, 0x6a, 0x3e, 0x81, 0xed, 0x4b, 0xc2,
-	0x83, 0x63, 0x25, 0xc3, 0x63, 0x1e, 0xf9, 0x44, 0xd1, 0xa4, 0xef, 0x76, 0x01, 0xbe, 0x9b, 0xb0,
-	0x09, 0xf3, 0x22, 0xfe, 0x9a, 0x25, 0x12, 0x2a, 0x16, 0xb9, 0xe0, 0xaf, 0x59, 0xf3, 0x47, 0x07,
-	0x5c, 0xcc, 0x68, 0x76, 0xcf, 0x03, 0xa8, 0x8d, 0xb9, 0xf0, 0xf4, 0x48, 0xb1, 0x68, 0x24, 0x83,
-	0x54, 0x79, 0x75, 0xcc, 0xc5, 0x65, 0x8a, 0x59, 0x12, 0xb9, 0x5a, 0x20, 0xe5, 0x13, 0x12, 0xb9,
-	0x9a, 0x93, 0x1e, 0xc1, 0x6d, 0x43, 0x0a, 0x95, 0xec, 0x93, 0x3e, 0x0f, 0xe6, 0x4d, 0x58, 0x1f,
-	0x93, 0xab, 0xf3, 0x39, 0xda, 0xfc, 0xd5, 0x81, 0xad, 0xde, 0x4a, 0x20, 0x9f, 0xc3, 0xc6, 0x50,
-	0x31, 0x16, 0x57, 0xdc, 0xca, 0x9d, 0x2c, 0xd3, 0x71, 0x4c, 0x46, 0x4f, 0xa0, 0x78, 0xcd, 0x82,
-	0x40, 0xc6, 0xc3, 0xe2, 0xcd, 0xdb, 0x12, 0x36, 0xfa, 0x14, 0x0a, 0x8a, 0xd1, 0xa4, 0x16, 0xdf,
-	0xb4, 0xc9, 0x50, 0x9b, 0x7f, 0xe4, 0xa1, 0x96, 0x8d, 0xb8, 0x03, 0x75, 0x1a, 0x03, 0xe9, 0xf0,
-	0x88, 0x9b, 0xe5, 0xde, 0x72, 0xb3, 0x58, 0x4e, 0x32, 0x39, 0x6a, 0x74, 0xd1, 0x44, 0xdf, 0x42,
-	0x43, 0x13, 0x1e, 0x78, 0x54, 0xc9, 0xd0, 0x4b, 0xbd, 0xf9, 0xd6, 0x7f, 0xa2, 0xe8, 0xc1, 0x52,
-	0x71, 0xac, 0xcb, 0xfc, 0x69, 0x0e, 0x6f, 0xeb, 0xb5, 0x25, 0x71, 0x06, 0x48, 0x31, 0xba, 0xec,
-	0xf9, 0x1f, 0xc9, 0x3e, 0xcd, 0x61, 0x57, 0x2d, 0x67, 0xe9, 0x15, 0xdc, 0x99, 0xae, 0x71, 0x18,
-	0xf7, 0xe2, 0x07, 0x59, 0x87, 0xbd, 0x35, 0x1e, 0xb7, 0xa6, 0xcb, 0x2e, 0x3b, 0xee, 0xfc, 0x1a,
-	0x63, 0x6f, 0xcd, 0x9f, 0x0b, 0x50, 0x4d, 0x9a, 0xe0, 0x95, 0xa9, 0xde, 0xb7, 0x9d, 0x48, 0xbb,
-	0x00, 0x43, 0x36, 0xb6, 0xbd, 0x38, 0x6b, 0xdd, 0x4a, 0x82, 0x74, 0xa9, 0x19, 0x58, 0x61, 0x9f,
-	0x6b, 0x6f, 0x4c, 0x42, 0x7b, 0x23, 0x15, 0x5c, 0x32, 0xf6, 0x0b, 0x12, 0xa2, 0x87, 0x50, 0x27,
-	0x2c, 0xf2, 0x98, 0xf0, 0xd5, 0x75, 0x68, 0x4f, 0x35, 0x0a, 0xcb, 0xb8, 0x46, 0x58, 0x74, 0x32,
-	0x03, 0xff, 0x83, 0x9f, 0x47, 0xe6, 0x9f, 0x55, 0xfc, 0xdb, 0x7f, 0x56, 0x29, 0xf3, 0xcf, 0x5a,
-	0x2d, 0xbc, 0xf2, 0xbf, 0x2e, 0xbc, 0xce, 0xf2, 0xad, 0x37, 0x2a, 0x36, 0x87, 0xeb, 0x7d, 0x24,
-	0x8d, 0x90, 0xfa, 0x88, 0xcd, 0xe6, 0x2f, 0x0e, 0xd4, 0x16, 0xf3, 0xf4, 0xff, 0x4f, 0xd0, 0xf6,
-	0x7c, 0x82, 0xda, 0xb9, 0x16, 0x35, 0x8a, 0x76, 0x82, 0xee, 0xac, 0x9d, 0xa0, 0x36, 0xa8, 0xd9,
-	0xf4, 0x8c, 0x43, 0x6c, 0x7d, 0x09, 0x95, 0x59, 0xb1, 0xa0, 0x2a, 0x94, 0xbf, 0x3e, 0xbf, 0xb8,
-	0xc4, 0x27, 0xed, 0x17, 0x6e, 0x0e, 0xd5, 0x01, 0x8e, 0x5f, 0xf6, 0xce, 0x12, 0xdb, 0x41, 0x5b,
-	0x50, 0xeb, 0x74, 0x8f, 0xbb, 0xf8, 0xe4, 0xf9, 0x65, 0xf7, 0xe5, 0x59, 0xfb, 0x2b, 0x37, 0xdf,
-	0x7a, 0x0a, 0xee, 0x72, 0x3e, 0x51, 0x09, 0x0a, 0x3d, 0x8c, 0xdd, 0x1c, 0x42, 0x50, 0xbf, 0xd0,
-	0x8a, 0xfb, 0xfa, 0x3c, 0xc9, 0xa0, 0xeb, 0x20, 0x80, 0xe2, 0xe9, 0x75, 0x5f, 0x71, 0xea, 0xe6,
-	0x5b, 0x02, 0xaa, 0x8b, 0xaf, 0x17, 0xb4, 0x0d, 0x5b, 0x8b, 0xb6, 0x77, 0x26, 0x05, 0x73, 0x73,
-	0xe8, 0x0e, 0xdc, 0xce, 0xc2, 0x6d, 0xd7, 0x41, 0xf7, 0xe0, 0x6e, 0x06, 0xec, 0xb0, 0x48, 0x9f,
-	0x0c, 0x06, 0x52, 0x69, 0x37, 0xbf, 0xe2, 0xa8, 0x3d, 0xd1, 0xd2, 0x2d, 0xb4, 0x9e, 0xcd, 0x26,
-	0x56, 0x12, 0x69, 0x15, 0xca, 0xe9, 0xfc, 0x70, 0x73, 0xa8, 0x06, 0x95, 0xde, 0xcc, 0x74, 0x8c,
-	0x0c, 0xcc, 0xa8, 0x9b, 0x47, 0x65, 0xb8, 0x65, 0x5a, 0xd7, 0x2d, 0xb4, 0x7e, 0x72, 0xe0, 0xfe,
-	0x4d, 0x2f, 0x09, 0xf4, 0x10, 0x3e, 0xbc, 0xe9, 0x7b, 0xaa, 0x68, 0x1f, 0x3e, 0xba, 0x91, 0xd6,
-	0x8e, 0xa2, 0x89, 0x62, 0xd4, 0x75, 0xd0, 0xc7, 0xf0, 0xe8, 0x46, 0xe6, 0xa2, 0xec, 0xce, 0xe3,
-	0x6f, 0x3e, 0x1b, 0x72, 0x3d, 0x9a, 0xf4, 0x0f, 0x7c, 0x39, 0x3e, 0x94, 0x21, 0x13, 0xbe, 0x54,
-	0xf4, 0x30, 0x7e, 0xdf, 0x7e, 0x92, 0xbc, 0x6f, 0x87, 0x32, 0xf3, 0xc4, 0xed, 0x17, 0x2d, 0xfe,
-	0xf8, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5f, 0x7b, 0x91, 0x72, 0x07, 0x0b, 0x00, 0x00,
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/google/api/annotations.proto b/vendor/github.com/opencord/voltha-protos/protos/google/api/annotations.proto
deleted file mode 100644
index 85c361b..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/google/api/annotations.proto
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2015, Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-package google.api;
-
-import "google/api/http.proto";
-import "google/protobuf/descriptor.proto";
-
-option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
-option java_multiple_files = true;
-option java_outer_classname = "AnnotationsProto";
-option java_package = "com.google.api";
-option objc_class_prefix = "GAPI";
-
-extend google.protobuf.MethodOptions {
-  // See `HttpRule`.
-  HttpRule http = 72295728;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/google/api/http.proto b/vendor/github.com/opencord/voltha-protos/protos/google/api/http.proto
deleted file mode 100644
index 673adc0..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/google/api/http.proto
+++ /dev/null
@@ -1,380 +0,0 @@
-// Copyright 2018 Google LLC.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-syntax = "proto3";
-
-package google.api;
-
-option cc_enable_arenas = true;
-option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
-option java_multiple_files = true;
-option java_outer_classname = "HttpProto";
-option java_package = "com.google.api";
-option objc_class_prefix = "GAPI";
-
-// Defines the HTTP configuration for an API service. It contains a list of
-// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
-// to one or more HTTP REST API methods.
-message Http {
-  // A list of HTTP configuration rules that apply to individual API methods.
-  //
-  // **NOTE:** All service configuration rules follow "last one wins" order.
-  repeated HttpRule rules = 1;
-
-  // When set to true, URL path parmeters will be fully URI-decoded except in
-  // cases of single segment matches in reserved expansion, where "%2F" will be
-  // left encoded.
-  //
-  // The default behavior is to not decode RFC 6570 reserved characters in multi
-  // segment matches.
-  bool fully_decode_reserved_expansion = 2;
-}
-
-// # gRPC Transcoding
-//
-// gRPC Transcoding is a feature for mapping between a gRPC method and one or
-// more HTTP REST endpoints. It allows developers to build a single API service
-// that supports both gRPC APIs and REST APIs. Many systems, including [Google
-// APIs](https://github.com/googleapis/googleapis),
-// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC
-// Gateway](https://github.com/grpc-ecosystem/grpc-gateway),
-// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature
-// and use it for large scale production services.
-//
-// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies
-// how different portions of the gRPC request message are mapped to the URL
-// path, URL query parameters, and HTTP request body. It also controls how the
-// gRPC response message is mapped to the HTTP response body. `HttpRule` is
-// typically specified as an `google.api.http` annotation on the gRPC method.
-//
-// Each mapping specifies a URL path template and an HTTP method. The path
-// template may refer to one or more fields in the gRPC request message, as long
-// as each field is a non-repeated field with a primitive (non-message) type.
-// The path template controls how fields of the request message are mapped to
-// the URL path.
-//
-// Example:
-//
-//     service Messaging {
-//       rpc GetMessage(GetMessageRequest) returns (Message) {
-//         option (google.api.http) = {
-//             get: "/v1/{name=messages/*}"
-//         };
-//       }
-//     }
-//     message GetMessageRequest {
-//       string name = 1; // Mapped to URL path.
-//     }
-//     message Message {
-//       string text = 1; // The resource content.
-//     }
-//
-// This enables an HTTP REST to gRPC mapping as below:
-//
-// HTTP | gRPC
-// -----|-----
-// `GET /v1/messages/123456`  | `GetMessage(name: "messages/123456")`
-//
-// Any fields in the request message which are not bound by the path template
-// automatically become HTTP query parameters if there is no HTTP request body.
-// For example:
-//
-//     service Messaging {
-//       rpc GetMessage(GetMessageRequest) returns (Message) {
-//         option (google.api.http) = {
-//             get:"/v1/messages/{message_id}"
-//         };
-//       }
-//     }
-//     message GetMessageRequest {
-//       message SubMessage {
-//         string subfield = 1;
-//       }
-//       string message_id = 1; // Mapped to URL path.
-//       int64 revision = 2;    // Mapped to URL query parameter `revision`.
-//       SubMessage sub = 3;    // Mapped to URL query parameter `sub.subfield`.
-//     }
-//
-// This enables a HTTP JSON to RPC mapping as below:
-//
-// HTTP | gRPC
-// -----|-----
-// `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
-// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
-// "foo"))`
-//
-// Note that fields which are mapped to URL query parameters must have a
-// primitive type or a repeated primitive type or a non-repeated message type.
-// In the case of a repeated type, the parameter can be repeated in the URL
-// as `...?param=A&param=B`. In the case of a message type, each field of the
-// message is mapped to a separate parameter, such as
-// `...?foo.a=A&foo.b=B&foo.c=C`.
-//
-// For HTTP methods that allow a request body, the `body` field
-// specifies the mapping. Consider a REST update method on the
-// message resource collection:
-//
-//     service Messaging {
-//       rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
-//         option (google.api.http) = {
-//           patch: "/v1/messages/{message_id}"
-//           body: "message"
-//         };
-//       }
-//     }
-//     message UpdateMessageRequest {
-//       string message_id = 1; // mapped to the URL
-//       Message message = 2;   // mapped to the body
-//     }
-//
-// The following HTTP JSON to RPC mapping is enabled, where the
-// representation of the JSON in the request body is determined by
-// protos JSON encoding:
-//
-// HTTP | gRPC
-// -----|-----
-// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
-// "123456" message { text: "Hi!" })`
-//
-// The special name `*` can be used in the body mapping to define that
-// every field not bound by the path template should be mapped to the
-// request body.  This enables the following alternative definition of
-// the update method:
-//
-//     service Messaging {
-//       rpc UpdateMessage(Message) returns (Message) {
-//         option (google.api.http) = {
-//           patch: "/v1/messages/{message_id}"
-//           body: "*"
-//         };
-//       }
-//     }
-//     message Message {
-//       string message_id = 1;
-//       string text = 2;
-//     }
-//
-//
-// The following HTTP JSON to RPC mapping is enabled:
-//
-// HTTP | gRPC
-// -----|-----
-// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
-// "123456" text: "Hi!")`
-//
-// Note that when using `*` in the body mapping, it is not possible to
-// have HTTP parameters, as all fields not bound by the path end in
-// the body. This makes this option more rarely used in practice when
-// defining REST APIs. The common usage of `*` is in custom methods
-// which don't use the URL at all for transferring data.
-//
-// It is possible to define multiple HTTP methods for one RPC by using
-// the `additional_bindings` option. Example:
-//
-//     service Messaging {
-//       rpc GetMessage(GetMessageRequest) returns (Message) {
-//         option (google.api.http) = {
-//           get: "/v1/messages/{message_id}"
-//           additional_bindings {
-//             get: "/v1/users/{user_id}/messages/{message_id}"
-//           }
-//         };
-//       }
-//     }
-//     message GetMessageRequest {
-//       string message_id = 1;
-//       string user_id = 2;
-//     }
-//
-// This enables the following two alternative HTTP JSON to RPC mappings:
-//
-// HTTP | gRPC
-// -----|-----
-// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
-// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
-// "123456")`
-//
-// ## Rules for HTTP mapping
-//
-// 1. Leaf request fields (recursive expansion nested messages in the request
-//    message) are classified into three categories:
-//    - Fields referred by the path template. They are passed via the URL path.
-//    - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They
-//    are passed via the HTTP
-//      request body.
-//    - All other fields are passed via the URL query parameters, and the
-//      parameter name is the field path in the request message. A repeated
-//      field can be represented as multiple query parameters under the same
-//      name.
-//  2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL
-//  query parameter, all fields
-//     are passed via URL path and HTTP request body.
-//  3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP
-//  request body, all
-//     fields are passed via URL path and URL query parameters.
-//
-// ### Path template syntax
-//
-//     Template = "/" Segments [ Verb ] ;
-//     Segments = Segment { "/" Segment } ;
-//     Segment  = "*" | "**" | LITERAL | Variable ;
-//     Variable = "{" FieldPath [ "=" Segments ] "}" ;
-//     FieldPath = IDENT { "." IDENT } ;
-//     Verb     = ":" LITERAL ;
-//
-// The syntax `*` matches a single URL path segment. The syntax `**` matches
-// zero or more URL path segments, which must be the last part of the URL path
-// except the `Verb`.
-//
-// The syntax `Variable` matches part of the URL path as specified by its
-// template. A variable template must not contain other variables. If a variable
-// matches a single path segment, its template may be omitted, e.g. `{var}`
-// is equivalent to `{var=*}`.
-//
-// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL`
-// contains any reserved character, such characters should be percent-encoded
-// before the matching.
-//
-// If a variable contains exactly one path segment, such as `"{var}"` or
-// `"{var=*}"`, when such a variable is expanded into a URL path on the client
-// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The
-// server side does the reverse decoding. Such variables show up in the
-// [Discovery
-// Document](https://developers.google.com/discovery/v1/reference/apis) as
-// `{var}`.
-//
-// If a variable contains multiple path segments, such as `"{var=foo/*}"`
-// or `"{var=**}"`, when such a variable is expanded into a URL path on the
-// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded.
-// The server side does the reverse decoding, except "%2F" and "%2f" are left
-// unchanged. Such variables show up in the
-// [Discovery
-// Document](https://developers.google.com/discovery/v1/reference/apis) as
-// `{+var}`.
-//
-// ## Using gRPC API Service Configuration
-//
-// gRPC API Service Configuration (service config) is a configuration language
-// for configuring a gRPC service to become a user-facing product. The
-// service config is simply the YAML representation of the `google.api.Service`
-// proto message.
-//
-// As an alternative to annotating your proto file, you can configure gRPC
-// transcoding in your service config YAML files. You do this by specifying a
-// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same
-// effect as the proto annotation. This can be particularly useful if you
-// have a proto that is reused in multiple services. Note that any transcoding
-// specified in the service config will override any matching transcoding
-// configuration in the proto.
-//
-// Example:
-//
-//     http:
-//       rules:
-//         # Selects a gRPC method and applies HttpRule to it.
-//         - selector: example.v1.Messaging.GetMessage
-//           get: /v1/messages/{message_id}/{sub.subfield}
-//
-// ## Special notes
-//
-// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the
-// proto to JSON conversion must follow the [proto3
-// specification](https://developers.google.com/protocol-buffers/docs/proto3#json).
-//
-// While the single segment variable follows the semantics of
-// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String
-// Expansion, the multi segment variable **does not** follow RFC 6570 Section
-// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion
-// does not expand special characters like `?` and `#`, which would lead
-// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding
-// for multi segment variables.
-//
-// The path variables **must not** refer to any repeated or mapped field,
-// because client libraries are not capable of handling such variable expansion.
-//
-// The path variables **must not** capture the leading "/" character. The reason
-// is that the most common use case "{var}" does not capture the leading "/"
-// character. For consistency, all path variables must share the same behavior.
-//
-// Repeated message fields must not be mapped to URL query parameters, because
-// no client library can support such complicated mapping.
-//
-// If an API needs to use a JSON array for request or response body, it can map
-// the request or response body to a repeated field. However, some gRPC
-// Transcoding implementations may not support this feature.
-message HttpRule {
-  // Selects a method to which this rule applies.
-  //
-  // Refer to [selector][google.api.DocumentationRule.selector] for syntax
-  // details.
-  string selector = 1;
-
-  // Determines the URL pattern is matched by this rules. This pattern can be
-  // used with any of the {get|put|post|delete|patch} methods. A custom method
-  // can be defined using the 'custom' field.
-  oneof pattern {
-    // Maps to HTTP GET. Used for listing and getting information about
-    // resources.
-    string get = 2;
-
-    // Maps to HTTP PUT. Used for replacing a resource.
-    string put = 3;
-
-    // Maps to HTTP POST. Used for creating a resource or performing an action.
-    string post = 4;
-
-    // Maps to HTTP DELETE. Used for deleting a resource.
-    string delete = 5;
-
-    // Maps to HTTP PATCH. Used for updating a resource.
-    string patch = 6;
-
-    // The custom pattern is used for specifying an HTTP method that is not
-    // included in the `pattern` field, such as HEAD, or "*" to leave the
-    // HTTP method unspecified for this rule. The wild-card rule is useful
-    // for services that provide content to Web (HTML) clients.
-    CustomHttpPattern custom = 8;
-  }
-
-  // The name of the request field whose value is mapped to the HTTP request
-  // body, or `*` for mapping all request fields not captured by the path
-  // pattern to the HTTP body, or omitted for not having any HTTP request body.
-  //
-  // NOTE: the referred field must be present at the top-level of the request
-  // message type.
-  string body = 7;
-
-  // Optional. The name of the response field whose value is mapped to the HTTP
-  // response body. When omitted, the entire response message will be used
-  // as the HTTP response body.
-  //
-  // NOTE: The referred field must be present at the top-level of the response
-  // message type.
-  string response_body = 12;
-
-  // Additional HTTP bindings for the selector. Nested bindings must
-  // not contain an `additional_bindings` field themselves (that is,
-  // the nesting may only be one level deep).
-  repeated HttpRule additional_bindings = 11;
-}
-
-// A custom pattern is used for defining custom HTTP verb.
-message CustomHttpPattern {
-  // The name of this custom HTTP verb.
-  string kind = 1;
-
-  // The path matched by this custom verb.
-  string path = 2;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/adapter.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/adapter.proto
deleted file mode 100644
index 055de2b..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/adapter.proto
+++ /dev/null
@@ -1,43 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/protobuf/any.proto";
-import "voltha_protos/common.proto";
-import "voltha_protos/meta.proto";
-
-
-message AdapterConfig {
-
-    // Common adapter config attributes here
-    common.LogLevel.LogLevel log_level = 1;
-
-    // Custom (vendor-specific) configuration attributes
-    google.protobuf.Any additional_config = 64;
-
-}
-
-// Adapter (software plugin)
-message Adapter {
-
-    // Unique name of adapter, matching the python package name under
-    // voltha/adapters.
-    string id = 1 [(access) = READ_ONLY];
-    string vendor = 2 [(access) = READ_ONLY];
-    string version = 3 [(access) = READ_ONLY];
-
-    // Adapter configuration
-    AdapterConfig config = 16;
-
-    // Custom descriptors and custom configuration
-    google.protobuf.Any additional_description = 64 [(access) = READ_ONLY];
-
-    repeated string logical_device_ids = 4;  // Logical devices "owned"
-
-}
-
-message Adapters {
-    repeated Adapter items = 1;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/afrouter.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/afrouter.proto
deleted file mode 100644
index c10a00f..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/afrouter.proto
+++ /dev/null
@@ -1,51 +0,0 @@
-// protoc -I echo/ echo/*.proto --go_out=plugins=grpc:echo
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/afrouter";
-
-package afrouter;
-
-// For logging
-import "voltha_protos/common.proto";
-
-service Configuration {
-   	rpc SetConnection (Conn) returns (Result) {}
-	rpc SetAffinity(Affinity) returns (Result) {}
-	rpc GetGoroutineCount(Empty) returns (Count) {}
-	rpc UpdateLogLevel(common.Logging) returns (Empty) {}
-	rpc GetLogLevels(common.LoggingComponent) returns (common.Loggings) {}
-}
-
-message Result {
-	bool success = 1;
-	string error = 2;
-	string info = 3;
-}
-
-message Empty {
-}
-
-message Count {
-    uint32 count = 1;
-}
-
-message Conn {
-	string server = 1;
-	string pkg = 2;
-	string svc = 3;
-	string cluster = 4;
-	string backend = 5;
-	string connection = 6;
-	string addr = 7;
-	uint64 port = 8;
-}
-
-message Affinity {
-	string router = 1;
-	string route = 2;
-	string cluster = 3;
-	string backend = 4;
-	string id = 5;
-}
-
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/common.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/common.proto
deleted file mode 100644
index f5e68c4..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/common.proto
+++ /dev/null
@@ -1,138 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/common";
-
-package common;
-
-import "voltha_protos/yang_options.proto";
-
-// Convey a resource identifier
-message ID {
-    string id = 1;
-}
-
-// Represents a list of IDs
-message IDs {
-    repeated ID items = 1;
-}
-
-enum TestModeKeys {
-    api_test=0;
-}
-
-message LogLevel {
-    option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    // Logging verbosity level
-    enum LogLevel {
-        DEBUG = 0;
-        INFO = 1;
-        WARNING = 2;
-        ERROR = 3;
-        CRITICAL = 4;
-        FATAL = 5;
-    }
-}
-
-message Logging {
-    common.LogLevel.LogLevel level = 1;
-    string package_name = 2;
-    string component_name = 3;
-}
-
-// For GetLogLevels(), select component to query
-message LoggingComponent {
-    string component_name = 1;
-}
-
-// For returning multiple log levels
-message Loggings {
-	repeated Logging items = 1;
-}
-
-message AdminState {
-    option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    // Administrative State
-    enum AdminState {
-
-        // The administrative state of the device is unknown
-        UNKNOWN = 0;
-
-        // The device is pre-provisioned into Voltha, but not contacted by it
-        PREPROVISIONED = 1;
-
-        // The device is enabled for activation and operation
-        ENABLED = 2;
-
-        // The device is disabled and shall not perform its intended forwarding
-        // functions other than being available for re-activation.
-        DISABLED = 3;
-
-        // The device is in the state of image download
-        DOWNLOADING_IMAGE = 4;
-
-        // The device is marked to be deleted
-        DELETED = 5;
-    }
-}
-
-message OperStatus {
-    option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    // Operational Status
-    enum OperStatus {
-
-        // The status of the device is unknown at this point
-        UNKNOWN = 0;
-
-        // The device has been discovered, but not yet activated
-        DISCOVERED = 1;
-
-        // The device is being activated (booted, rebooted, upgraded, etc.)
-        ACTIVATING = 2;
-
-        // Service impacting tests are being conducted
-        TESTING = 3;
-
-        // The device is up and active
-        ACTIVE = 4;
-
-        // The device has failed and cannot fulfill its intended role
-        FAILED = 5;
-    }
-}
-
-message ConnectStatus {
-    option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    // Connectivity Status
-    enum ConnectStatus {
-
-        // The device connectivity status is unknown
-        UNKNOWN = 0;
-
-        // The device cannot be reached by Voltha
-        UNREACHABLE = 1;
-
-        // There is live communication between device and Voltha
-        REACHABLE = 2;
-    }
-}
-
-message OperationResp {
-    option (yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    enum OperationReturnCode {
-        OPERATION_SUCCESS = 0;
-        OPERATION_FAILURE = 1;
-        OPERATION_UNSUPPORTED = 2;
-    }
-    // Return code
-    OperationReturnCode code = 1;
-
-    // Additional Info
-    string additional_info = 2;
-}
-
-
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/device.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/device.proto
deleted file mode 100644
index 0b31ed1..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/device.proto
+++ /dev/null
@@ -1,329 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/protobuf/any.proto";
-import "voltha_protos/common.proto";
-import "voltha_protos/meta.proto";
-import "voltha_protos/openflow_13.proto";
-import "voltha_protos/yang_options.proto";
-
-// A Device Type
-message DeviceType {
-
-    // Unique name for the device type
-    string id = 1;
-
-    // Unique vendor id for the device type applicable to ONU
-    // 4 bytes of vendor id from ONU serial number
-    string vendor_id = 5;
-
-    repeated string vendor_ids = 6;
-
-    // Name of the adapter that handles device type
-    string adapter = 2;
-
-    // Capabilities
-    bool accepts_bulk_flow_update = 3;
-    bool accepts_add_remove_flow_updates = 4;
-    bool accepts_direct_logical_flows_update = 7;
-
-}
-
-// A plurality of device types
-message DeviceTypes {
-    repeated DeviceType items = 1;
-}
-
-message PmConfig {
-    enum PmType {
-        COUNTER = 0;
-        GAUGE = 1;
-        STATE = 2;
-        CONTEXT = 3;
-    }
-    string name = 1;
-    PmType type = 2;
-    bool enabled = 3; // Whether or not this metric makes it to Kafka
-    uint32 sample_freq = 4; // Sample rate in 10ths of a second
-}
-
-message PmGroupConfig {
-    string group_name = 1;
-    uint32 group_freq = 2; // Frequency applicable to the grop
-    bool enabled = 3; // Enable/disable group level only
-    repeated PmConfig metrics = 4;
-}
-
-message PmConfigs {
-    string id = 1; // To work around a chameleon POST bug
-    uint32 default_freq = 2; // Default sample rate
-    // Forces group names and group semantics
-    bool grouped = 3 [(access) = READ_ONLY];
-    // Allows Pm to set an individual sample frequency
-    bool freq_override = 4 [(access) = READ_ONLY];
-    repeated PmGroupConfig groups = 5; // The groups if grouped is true
-    repeated PmConfig metrics = 6; // The metrics themselves if grouped is false.
-}
-
-// Describes instance of software image on the device
-message Image {
-    string name = 1;                // software patch name
-    string version = 2;             // version of software
-    string hash = 3;                // md5 hash
-    string install_datetime = 4;    // combined date and time expressed in UTC.
-                                    // use ISO 8601 format for date and time
-
-    // The active software image is one that is currently loaded and executing
-    // in the ONU or circuit pack. Under normal operation, one software image
-    // is always active while the other is inactive. Under no circumstances are
-    // both software images allowed to be active at the same time
-    bool is_active = 5;             // True if the image is active
-
-    // The committed software image is loaded and executed upon reboot of the
-    // ONU and/or circuit pack. During normal operation, one software image is
-    // always committed, while the other is uncommitted.
-    bool is_committed = 6;          // True if the image is committed
-
-    // A software image is valid if it has been verified to be an executable
-    // code image. The verification mechanism is not subject to standardization;
-    // however, it should include at least a data integrity (e.g., CRC) check of
-    // the entire code image.
-    bool is_valid = 7;              // True if the image is valid
-}
-
-// List of software on the device
-message Images {
-    repeated Image image = 1;
-}
-
-message ImageDownload {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    enum ImageDownloadState {
-        DOWNLOAD_UNKNOWN = 0;
-        DOWNLOAD_SUCCEEDED = 1;
-        DOWNLOAD_REQUESTED = 2;
-        DOWNLOAD_STARTED = 3;
-        DOWNLOAD_FAILED = 4;
-        DOWNLOAD_UNSUPPORTED = 5;
-        DOWNLOAD_CANCELLED = 6;
-    }
-
-    enum ImageDownloadFailureReason {
-        NO_ERROR = 0;
-        INVALID_URL = 1;
-        DEVICE_BUSY = 2;
-        INSUFFICIENT_SPACE = 3;
-        UNKNOWN_ERROR = 4;
-        CANCELLED = 5;
-    }
-
-    enum ImageActivateState {
-        IMAGE_UNKNOWN = 0;
-        IMAGE_INACTIVE = 1;
-        IMAGE_ACTIVATING = 2;
-        IMAGE_ACTIVE = 3;
-        IMAGE_REVERTING = 4;
-        IMAGE_REVERTED = 5;
-    }
-
-    // Device Identifier
-    string id = 1;
-
-    // Image unique identifier
-    string name = 2;
-
-    // URL where the image is available
-    // should include username password
-    string url = 3;
-
-    // CRC of the image to be verified aginst
-    uint32 crc = 4;
-
-    // Download state
-    ImageDownloadState download_state = 5;
-
-    // Downloaded version
-    string image_version = 6;
-
-    // Bytes downloaded
-    uint32 downloaded_bytes = 7;
-
-    // Download failure reason
-    ImageDownloadFailureReason reason= 8;
-
-    // Additional info
-    string additional_info = 9;
-
-    // Save current configuration
-    bool save_config = 10;
-
-    // Image local location
-    string local_dir = 11;
-
-    // Image activation state
-    ImageActivateState image_state = 12;
-    
-    // Image file size
-    uint32 file_size = 13;
-}
-
-message ImageDownloads {
-    repeated ImageDownload items = 2;
-}
-
-message Port {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    enum PortType {
-        UNKNOWN = 0;
-        ETHERNET_NNI = 1;
-        ETHERNET_UNI = 2;
-        PON_OLT = 3;
-        PON_ONU = 4;
-        VENET_OLT = 5;
-        VENET_ONU = 6;
-    }
-
-    uint32 port_no = 1;  // Device-unique port number
-
-    string label = 2;  // Arbitrary port label
-
-    PortType type = 3;  //  Type of port
-
-    common.AdminState.AdminState admin_state = 5;
-
-    common.OperStatus.OperStatus oper_status = 6;
-
-    string device_id = 7;  // Unique .id of device that owns this port
-
-    message PeerPort {
-        string device_id = 1;
-        uint32 port_no = 2;
-    }
-    repeated PeerPort peers = 8;
-
-    fixed64 rx_packets = 9;
-    fixed64 rx_bytes = 10;
-    fixed64 rx_errors = 11;
-    fixed64 tx_packets = 12;
-    fixed64 tx_bytes = 13;
-    fixed64 tx_errors = 14;
-
-}
-
-message Ports {
-    repeated Port items = 1;
-}
-
-// A Physical Device instance
-message Device {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    // Voltha's device identifier
-    string id = 1 [(access) = READ_ONLY];
-
-    // Device type, refers to one of the registered device types
-    string type = 2 [(access) = READ_ONLY];
-
-    // Is this device a root device. Each logical switch has one root
-    // device that is associated with the logical flow switch.
-    bool root = 3 [(access) = READ_ONLY];
-
-    // Parent device id, in the device tree (for a root device, the parent_id
-    // is the logical_device.id)
-    string parent_id = 4 [(access) = READ_ONLY];
-    uint32 parent_port_no = 20 [(access) = READ_ONLY];
-
-    // Vendor, version, serial number, etc.
-    string vendor = 5 [(access) = READ_ONLY];
-    string model = 6 [(access) = READ_ONLY];
-    string hardware_version = 7 [(access) = READ_ONLY];
-    string firmware_version = 8 [(access) = READ_ONLY];
-    // List of software on the device
-    Images images = 9 [(access) = READ_ONLY];
-    string serial_number = 10 [(access) = READ_ONLY];
-    string vendor_id = 24 [(access) = READ_ONLY];
-
-    // Addapter that takes care of device
-    string adapter = 11 [(access) = READ_ONLY];
-
-    // Device contact on vlan (if 0, no vlan)
-    uint32 vlan = 12;
-
-    message ProxyAddress {
-        string device_id = 1;  // Which device to use as proxy to this device
-        string device_type = 2; // The device type of the proxy device to use as the adapter name
-        uint32 channel_id = 3;  // Sub-address within proxy
-        uint32 channel_group_id = 4; // Channel Group index
-        string channel_termination = 5; // Channel Termination name
-        uint32 onu_id = 6; // onu identifier; optional
-        uint32 onu_session_id = 7; // session identifier for the ONU; optional
-    };
-
-    // Device contact MAC address (format: "xx:xx:xx:xx:xx:xx")
-    string mac_address = 13;
-
-    oneof address {
-
-        // Device contact IPv4 address (format: "a.b.c.d" or can use hostname too)
-        string ipv4_address = 14;
-
-        // Device contact IPv6 address using the canonical string form
-        // ("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
-        string ipv6_address = 15;
-
-        string host_and_port = 21;
-
-    };
-    string extra_args = 23;  // Used to pass additional device specific arguments
-
-    ProxyAddress proxy_address = 19;
-
-    common.AdminState.AdminState admin_state = 16;
-
-    common.OperStatus.OperStatus oper_status = 17 [(access) = READ_ONLY];
-
-    string reason = 22 [(access) = READ_ONLY];  //  Used in FAILED state
-
-    common.ConnectStatus.ConnectStatus connect_status = 18 [(access) = READ_ONLY];
-
-    // TODO additional common attribute here
-
-    // Device type specific attributes
-    google.protobuf.Any custom = 64;
-
-    repeated Port ports = 128  [(child_node) = {key: "port_no"}];
-    openflow_13.Flows flows = 129 [(child_node) = {}];
-    openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
-    // PmConfigs will eventually converted to a child node of the
-    // device to falicitata callbacks and to simplify manipulation.
-    PmConfigs pm_configs = 131 [(child_node) = {}];
-
-    repeated ImageDownload image_downloads = 133 [(child_node) = {key: "name"}];
-}
-
-message Devices {
-    repeated Device items = 1;
-}
-
-message SimulateAlarmRequest {
-    enum OperationType {
-        RAISE = 0;
-        CLEAR = 1;
-    }
-    // Device Identifier
-    string id = 1;
-    string indicator = 2;
-    string intf_id = 3;
-    string port_type_name = 4;
-    string onu_device_id = 5;
-    int32 inverse_bit_error_rate = 6;
-    int32 drift = 7;
-    int32 new_eqd = 8;
-    string onu_serial_number = 9;
-    OperationType operation = 10;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/events.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/events.proto
deleted file mode 100644
index 6c93a02..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/events.proto
+++ /dev/null
@@ -1,333 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "voltha_protos/meta.proto";
-import "google/api/annotations.proto";
-
-message ConfigEventType {
-    enum ConfigEventType {
-        add = 0; // A new config has been added
-        remove = 1; // A config has been removed
-        update = 2; // A config has been updated
-    }
-}
-
-message ConfigEvent {
-    ConfigEventType.ConfigEventType type = 1;
-
-    string hash = 2; // hash for this change, can be used for quick lookup
-    string data = 3; // the actual new data, in json format
-}
-
-message KpiEventType {
-    enum KpiEventType {
-        slice = 0; // slice: a set of path/metric data for same time-stamp
-        ts = 1; // time-series: array of data for same metric
-    }
-}
-
-/*
- * Struct to convey a dictionary of metric metadata.
- */
-message MetricMetaData {
-    string title = 1;   // Metric group or individual metric name
-    double ts = 2;      // UTC time-stamp of data (seconds since epoch) of
-                        // when the metric or metric group was collected.
-                        // If this is a 15-min historical group, it is the
-                        // time of the collection and reporting, not the
-                        // start or end of the 15-min group interval.
-
-    string logical_device_id = 3; // The logical device ID of the VOLTHA
-                                  // (equivalent to the DPID that ONOS has
-                                  // for the VOLTHA device without the
-                                  //  'of:' prefix
-    string serial_no = 4;         // The OLT, ONU, ... device serial number
-    string device_id = 5;         // The OLT, ONU, ... physical device ID
-
-    map<string, string> context = 6; // Name value pairs that provide additional
-                                     // context information on the metrics being
-                                     // reported.
-}
-
-/*
- * Struct to convey a dictionary of metric->value pairs. Typically used in
- * pure shared-timestamp or shared-timestamp + shared object prefix situations.
- */
-message MetricValuePairs {
-
-    // Metric / value pairs.
-    map<string, float> metrics = 1;
-
-}
-
-/*
- * Struct to group metadata for a metric (or group of metrics) with the key-value
- * pairs of collected metrics
- */
-message MetricInformation {
-    MetricMetaData metadata = 1;
-    map<string, float> metrics = 2;
-}
-
-/*
- * Legacy KPI Event structured.  In mid-August, the KPI event format was updated
- *                               to a more easily parsable format. See VOL-1140
- *                               for more information.
- */
-message KpiEvent {
-
-    KpiEventType.KpiEventType type = 1;
-
-    // Fields used when for slice:
-
-    float ts = 2; // UTC time-stamp of data in slice mode (seconds since epoc)
-
-    map<string, MetricValuePairs> prefixes = 3;
-
-}
-
-message KpiEvent2 {
-    // Type of KPI Event
-    KpiEventType.KpiEventType type = 1;
-
-    // Fields used when for slice:
-    double ts = 2;  // UTC time-stamp of data in slice mode (seconds since epoch)
-                    // of the time this entire KpiEvent was published to the kafka bus
-
-    repeated MetricInformation slice_data = 3;
-}
-
-/*
- * Identify to the area of the system impacted by the alarm
- * To be deprecated once python version of OpenOLT adapter
- * moves to the new event defination for device alarms
- */
-message AlarmEventType {
-    enum AlarmEventType {
-        COMMUNICATION = 0;
-        ENVIRONMENT = 1;
-        EQUIPMENT = 2;
-        SERVICE = 3;
-        PROCESSING = 4;
-        SECURITY = 5;
-    }
-}
-
-/*
- * Identify to the functional category originating the alarm
- * To be deprecated once python version of OpenOLT adapter
- * as well as OpenONU adapter moves to the new event
- * defination for device alarms
- */
-message AlarmEventCategory {
-    enum AlarmEventCategory {
-        PON = 0;
-        OLT = 1;
-        ONT = 2;
-        ONU = 3;
-        NNI = 4;
-    }
-}
-
-/*
- * Active state of the alarm
- * To be deprecated once python version of OpenOLT adapter
- * as well as OpenONU adapter moves to the new event
- * defination for device alarms
- */
-message AlarmEventState {
-    enum AlarmEventState {
-        RAISED = 0;
-        CLEARED = 1;
-    }
-}
-
-/*
- * Identify the overall impact of the alarm on the system
- * To be deprecated once python version of OpenOLT adapter
- * as well as OpenONU adapter moves to the new event
- * defination for device alarms
- */
-message AlarmEventSeverity {
-    enum AlarmEventSeverity {
-        INDETERMINATE = 0;
-        WARNING = 1;
-        MINOR = 2;
-        MAJOR = 3;
-        CRITICAL = 4;
-    }
-}
-
-/*
- * To be deprecated once python version of OpenOLT adapter
- * as well as OpenONU adapter moves to the new event
- * defination for device alarms
- */
-message AlarmEvent {
-    // Unique ID for this alarm.  e.g. voltha.some_olt.1234
-    string id = 1;
-
-    // Refers to the area of the system impacted by the alarm
-    AlarmEventType.AlarmEventType type = 2;
-
-    // Refers to functional category of the alarm
-    AlarmEventCategory.AlarmEventCategory category = 3;
-
-    // Current active state of the alarm
-    AlarmEventState.AlarmEventState state = 4;
-
-    // Overall impact of the alarm on the system
-    AlarmEventSeverity.AlarmEventSeverity severity = 5;
-
-    // Timestamp at which the alarm was first raised
-    float raised_ts = 6;
-
-    // Timestamp at which the alarm was reported
-    float reported_ts = 7;
-
-    // Timestamp at which the alarm has changed since it was raised
-    float changed_ts = 8;
-
-    // Identifier of the originating resource of the alarm
-    string resource_id = 9;
-
-    // Textual explanation of the alarm
-    string description = 10;
-
-    // Key/Value storage for extra information that may give context to the alarm
-    map<string, string> context = 11;
-
-    // logical device id
-    string logical_device_id = 12;
-
-    // alarm_type  name indicates clearly the name of the alarm
-    string alarm_type_name = 13;
-}
-/*
- * Describes the events specific to device
- */
-message DeviceEvent {
-    // Identifier of the originating resource of the event, for ex: device_id
-    string resource_id = 1;
-
-    // device_event_name indicates clearly the name of the device event
-    string device_event_name = 2;
-
-    // Textual explanation of the device event
-    string description = 3;
-
-    // Key/Value storage for extra information that may give context to the event
-    map<string, string> context = 4;
-
-}
-
-/*
- * Identify the area of the system impacted by the event.
- */
-message EventCategory {
-    enum EventCategory {
-        COMMUNICATION = 0;
-        ENVIRONMENT = 1;
-        EQUIPMENT = 2;
-        SERVICE = 3;
-        PROCESSING = 4;
-        SECURITY = 5;
-        // Add new event areas here
-    }
-}
-
-/*
- * Identify the functional category originating the event
- */
-message EventSubCategory {
-    enum EventSubCategory {
-        PON = 0;
-        OLT = 1;
-        ONT = 2;
-        ONU = 3;
-        NNI = 4;
-        // Add new event categories here.
-    }
-}
-
-/*
- * Identify the type of event
-*/
-message EventType {
-   enum EventType {
-       CONFIG_EVENT = 0;
-       KPI_EVENT    = 1;
-       KPI_EVENT2   = 2;
-       DEVICE_EVENT = 3;
-
-   }
-}
-
-/*
- * Identify the functional category originating the event
- */
-message EventHeader {
-    // Unique ID for this event.  e.g. voltha.some_olt.1234
-    string id = 1;
-
-    // Refers to the functional area affect by the event
-    EventCategory.EventCategory category = 2;
-
-    // Refers to functional category of the event
-    EventSubCategory.EventSubCategory sub_category = 3;
-
-    // Refers to the type of the event
-    EventType.EventType type = 4;
-
-    // The version identifier for this event type, thus allowing each
-    // event type to evolve independently. The version should be in the
-    // format “MAJOR.MINOR” format and minor changes must only be additive
-    // and non-breaking.
-    string type_version = 5;
-
-    // Timestamp at which the event was first raised.
-    // This represents the UTC time stamp since epoch (in seconds) when the
-    // the event was first raised from the source entity.
-    // If the source entity doesn't send the raised_ts, this shall be set
-    // to timestamp when the event was received.
-    float raised_ts = 6;
-
-    // Timestamp at which the event was reported.
-    // This represents the UTC time stamp since epoch (in seconds) when the
-    // the event was reported (this time stamp is >= raised_ts).
-    // If the source entity that reported this event doesn't send the 
-    // reported_ts, this shall be set to the same value as raised_ts.
-    float reported_ts = 7;
-
-
-}
-
-/*
- * Event Structure
- */
-message Event {
-    // event header
-    EventHeader header = 1;
-
-    // oneof event types referred by EventType.
-    oneof event_type {
-        // Refers to ConfigEvent
-        ConfigEvent config_event = 2;
-
-        // Refers to KpiEvent
-        KpiEvent    kpi_event = 3;
-
-        // Refers to KpiEvent2
-        KpiEvent2   kpi_event2 = 4;
-
-        // Refers to DeviceEvent
-        DeviceEvent device_event = 5;
-
-        // Add other event types here.
-
-    }
-}
-
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/health.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/health.proto
deleted file mode 100644
index 7721825..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/health.proto
+++ /dev/null
@@ -1,36 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/api/annotations.proto";
-import "google/protobuf/empty.proto";
-import "voltha_protos/meta.proto";
-
-// Encode health status of a Voltha instance
-message HealthStatus {
-
-    // Health states
-    enum HealthState {
-        HEALTHY = 0;  // The instance is healthy
-        OVERLOADED = 1;  // The instance is overloaded, decrease query rate
-        DYING = 2;  // The instance is in a critical condition, do not use it
-    }
-
-    // Current state of health of this Voltha instance
-    HealthState state = 1 [(access) = READ_ONLY];
-}
-
-// Health related services
-service HealthService {
-
-    // Return current health status of a Voltha instance
-    rpc GetHealthStatus(google.protobuf.Empty) returns (HealthStatus) {
-        option (google.api.http) = {
-            get: "/health"
-        };
-    }
-
-}
-
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ietf_interfaces.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ietf_interfaces.proto
deleted file mode 100644
index 50167cb..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ietf_interfaces.proto
+++ /dev/null
@@ -1,53 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/ietf";
-
-package ietf;
-
-message Interfaces {
-    repeated Interface all_interfaces = 1;
-}
-message Interface {
-    string name = 1 ;
-    string description = 2 ;
-    string type = 3 ;
-    bool enabled = 4;
-    enum LinkUpDownTrapEnableType
-    {
-        TRAP_DISABLED = 0 ;
-        TRAP_ENABLED = 1 ;
-    }
-    LinkUpDownTrapEnableType link_up_down_trap_enable = 5;
-}
-
-message InterfacesState {
-    repeated InterfaceState all_interfacs = 1;
-}
-message InterfaceState {
-    string name = 1 ;
-    string type = 2 ;
-    enum AdminStatusType
-    {
-        ADMIN_DOWN = 0 ;
-        ADMIN_TESTING = 1 ;
-        ADMIN_UP = 2 ;
-    }
-    AdminStatusType admin_status = 3;
-    enum OperStatusType
-    {
-        DORMANT = 0 ;
-        LOWER_LAYER_DOWN = 1 ;
-        UNKNOWN = 2 ;
-        TESTING = 3 ;
-        UP = 4 ;
-        DOWN = 5 ;
-        NOT_PRESENT = 6 ;
-    }
-    OperStatusType oper_status = 4;
-    string last_change = 5 ;
-    int32 if_index = 6 ;
-    string phys_address = 7 ;
-    repeated string higher_layer_if = 8 ;
-    repeated string lower_layer_if = 9 ;
-    uint64 speed = 10 ;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/inter_container.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/inter_container.proto
deleted file mode 100644
index 28af2bf..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/inter_container.proto
+++ /dev/null
@@ -1,140 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/inter_container";
-
-import public "voltha_protos/common.proto";
-import public "voltha_protos/voltha.proto";
-import "google/protobuf/any.proto";
-import "voltha_protos/openflow_13.proto";
-import public "voltha_protos/logical_device.proto";
-
-package voltha;
-
-message StrType {
-    string val = 1;
-}
-
-message IntType {
-    int64 val = 1;
-}
-
-message BoolType {
-    bool val = 1;
-}
-
-message Packet {
-    bytes payload = 1;
-}
-
-message ErrorCode {
-    enum codes {
-        UNSUPPORTED_REQUEST = 0;
-        INVALID_PARAMETERS = 1;
-    }
-}
-
-message Error {
-    ErrorCode code = 1;
-    string reason = 2;
-}
-
-enum MessageType {
-    REQUEST = 0;
-    RESPONSE = 1;
-    DEVICE_DISCOVERED=2;
-}
-
-message Header {
-    string id = 1;
-    MessageType type = 2;
-    string from_topic = 3;
-    string to_topic = 4;
-    string key_topic = 5;
-    int64 timestamp = 6;
-}
-
-message Argument {
-    string key = 1;
-    google.protobuf.Any value = 2;
-}
-
-message InterContainerMessage {
-    Header header = 1;
-    google.protobuf.Any body = 2;
-}
-
-message InterContainerRequestBody {
-    string rpc = 2;
-    repeated Argument args = 3;
-    bool response_required = 4;
-    string reply_to_topic = 5;
-}
-
-message InterContainerResponseBody {
-    bool success = 1;
-    google.protobuf.Any result = 3;
-}
-
-message SwitchCapability {
-    openflow_13.ofp_desc desc = 1;
-    openflow_13.ofp_switch_features switch_features = 2;
-}
-
-message PortCapability {
-    LogicalPort port = 1;
-}
-
-message DeviceDiscovered {
-    string id = 1;
-    string parent_id = 2;
-    string device_type = 3;
-    string publisher = 4;
-}
-
-message InterAdapterMessageType {
-    enum Types {
-        FLOW_REQUEST = 0;
-        FLOW_RESPONSE = 1;
-        OMCI_REQUEST = 2;
-        OMCI_RESPONSE = 3;
-        METRICS_REQUEST = 4;
-        METRICS_RESPONSE = 5;
-        ONU_IND_REQUEST = 6;
-        ONU_IND_RESPONSE = 7;
-        TECH_PROFILE_DOWNLOAD_REQUEST = 8;
-    }
-}
-
-message InterAdapterHeader {
-    string id = 1;
-    InterAdapterMessageType.Types type = 2;
-    string from_topic = 3;
-    string to_topic = 4;
-    string to_device_id = 5;
-    string proxy_device_id = 6;
-    int64 timestamp = 7;
-}
-
-message InterAdapterOmciMessage {
-    bytes message = 1; // OMCI_REQUEST or OMCI_RESPONSE
-    common.ConnectStatus.ConnectStatus connect_status = 2;
-    voltha.Device.ProxyAddress proxy_address = 3;
-}
-
-message InterAdapterTechProfileDownloadMessage {
-    uint32 uni_id = 1;
-    string path = 2;
-}
-
-message InterAdapterResponseBody {
-    bool status = 1;
-    oneof payload {
-        google.protobuf.Any body = 2;
-        InterAdapterOmciMessage omci = 3; // OMCI_REQUEST or OMCI_RESPONSE
-    }
-}
-
-message InterAdapterMessage {
-    InterAdapterHeader header = 1;
-    google.protobuf.Any body = 2;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/logical_device.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/logical_device.proto
deleted file mode 100644
index 84e7ec5..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/logical_device.proto
+++ /dev/null
@@ -1,66 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/api/annotations.proto";
-import "voltha_protos/meta.proto";
-import "voltha_protos/openflow_13.proto";
-
-message LogicalPortId {
-    // unique id of logical device
-    string id = 1;
-
-    // id of the port on the logical device
-    string port_id = 2;
-}
-
-message LogicalPort {
-    string id = 1;
-    openflow_13.ofp_port ofp_port = 2;
-    string device_id = 3;
-    uint32 device_port_no = 4;
-    bool root_port = 5;
-    openflow_13.ofp_port_stats ofp_port_stats = 6;
-}
-
-message LogicalPorts {
-    repeated LogicalPort items = 1;
-}
-
-message LogicalDevice {
-
-    // unique id of logical device
-    string id = 1;
-
-    // unique datapath id for the logical device (used by the SDN controller)
-    uint64 datapath_id = 2;
-
-    // device description
-    openflow_13.ofp_desc desc = 3;
-
-    // device features
-    openflow_13.ofp_switch_features switch_features = 4;
-
-    // name of the root device anchoring logical device
-    string root_device_id = 5;
-
-    // logical device ports
-    repeated LogicalPort ports = 128 [(child_node) = {key: "id"}];
-
-    // flows configured on the logical device
-    openflow_13.Flows flows = 129 [(child_node) = {}];
-
-    // flow groups configured on the logical device
-    openflow_13.FlowGroups flow_groups = 130 [(child_node) = {}];
-
-    // meters configured on the logical device
-    openflow_13.Meters meters = 131 [(child_node) = {}];
-
-
-}
-
-message LogicalDevices {
-    repeated LogicalDevice items = 1;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/meta.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/meta.proto
deleted file mode 100644
index a308ffa..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/meta.proto
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2015, Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file contains annotation definitions that can be used to describe
-// a configuration tree.
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/common";
-
-package voltha;
-
-import "google/protobuf/descriptor.proto";
-
-message ChildNode {
-    string key = 1;
-}
-
-enum Access {
-
-    // read-write, stored attribute
-    CONFIG = 0;
-
-    // read-only field, stored with the model, covered by its hash
-    READ_ONLY = 1;
-
-    // A read-only attribute that is not stored in the model, not covered
-    // by its hash, its value is filled real-time upon each request.
-    REAL_TIME = 2;
-
-}
-
-extend google.protobuf.FieldOptions {
-
-    // If present, it indicates that this field is stored as external child node
-    // or children nodes in Voltha's internal configuration tree.
-    // If the field is a container field and if the option specifies a key
-    // the child objects will be addressible by that key.
-    ChildNode child_node = 7761772;
-
-    // This annotation can be used to indicate that a field is read-only,
-    // from the perspective of NBI access. Backend plugins and system
-    // internals can update the field but the update requests through the
-    // NBI will ignore for instance a field that is marked as read-only (RO).
-    Access access = 7761773;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_alarm_db.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_alarm_db.proto
deleted file mode 100644
index 4385a6d..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_alarm_db.proto
+++ /dev/null
@@ -1,80 +0,0 @@
-//
-// Copyright 2018 - present the original author or authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/omci";
-
-package omci;
-
-import "voltha_protos/meta.proto";
-
-
-message AlarmAttributeData {
-    string name        = 1 [(voltha.access) = READ_ONLY];
-    string value       = 2;
-}
-
-message AlarmInstanceData {
-    uint32 instance_id      = 1 [(voltha.access) = READ_ONLY];
-    string created          = 2;
-    string modified         = 3;
-
-    repeated AlarmAttributeData attributes = 4
-    [(voltha.child_node) = {key: "name"}];
-}
-
-message AlarmClassData {
-    uint32 class_id         = 1 [(voltha.access) = READ_ONLY];
-
-    repeated AlarmInstanceData instances= 2
-    [(voltha.child_node) = {key: "instance_id"}];
-}
-
-message AlarmManagedEntity {
-    uint32 class_id  = 1 [(voltha.access) = READ_ONLY];
-    string name      = 2 [(voltha.access) = READ_ONLY];
-}
-
-message AlarmMessageType {
-    uint32 message_type = 1 [(voltha.access) = READ_ONLY];
-}
-
-message AlarmDeviceData {
-    string device_id             = 1 [(voltha.access) = READ_ONLY];
-    string created               = 2;
-    uint32 last_alarm_sequence   = 3;
-    string last_sync_time        = 4;
-    uint32 version               = 5;
-
-
-    repeated AlarmClassData classes = 6
-    [(voltha.child_node) = {key: "class_id"}];
-
-    repeated AlarmManagedEntity managed_entities = 7;
-    repeated AlarmMessageType message_types = 8;
-}
-
-message AlarmOpenOmciEventType {
-    enum OpenOmciEventType {
-        state_change = 0; // A state machine has transitioned to a new state
-    }
-}
-
-message AlarmOpenOmciEvent {
-    AlarmOpenOmciEventType.OpenOmciEventType type = 1;
-
-    string data = 2; // associated data, in json format
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_mib_db.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_mib_db.proto
deleted file mode 100644
index 9a2933a..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/omci_mib_db.proto
+++ /dev/null
@@ -1,79 +0,0 @@
-//
-// Copyright 2018 - present the original author or authors.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/omci";
-
-package omci;
-
-import "voltha_protos/meta.proto";
-
-
-message MibAttributeData {
-    string name        = 1 [(voltha.access) = READ_ONLY];
-    string value       = 2;
-}
-
-message MibInstanceData {
-    uint32 instance_id      = 1 [(voltha.access) = READ_ONLY];
-    string created          = 2;
-    string modified         = 3;
-
-    repeated MibAttributeData attributes = 4
-    [(voltha.child_node) = {key: "name"}];
-}
-
-message MibClassData {
-    uint32 class_id         = 1 [(voltha.access) = READ_ONLY];
-
-    repeated MibInstanceData instances= 2
-    [(voltha.child_node) = {key: "instance_id"}];
-}
-
-message ManagedEntity {
-    uint32 class_id  = 1 [(voltha.access) = READ_ONLY];
-    string name      = 2 [(voltha.access) = READ_ONLY];
-}
-
-message MessageType {
-    uint32 message_type = 1 [(voltha.access) = READ_ONLY];
-}
-
-message MibDeviceData {
-    string device_id        = 1 [(voltha.access) = READ_ONLY];
-    string created          = 2;
-    string last_sync_time   = 3;
-    uint32 mib_data_sync    = 4;
-    uint32 version          = 5;
-
-    repeated MibClassData classes = 6
-    [(voltha.child_node) = {key: "class_id"}];
-
-    repeated ManagedEntity managed_entities = 7;
-    repeated MessageType message_types = 8;
-}
-
-message OpenOmciEventType {
-    enum OpenOmciEventType {
-        state_change = 0; // A state machine has transitioned to a new state
-    }
-}
-
-message OpenOmciEvent {
-    OpenOmciEventType.OpenOmciEventType type = 1;
-
-    string data = 2; // associated data, in json format
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openflow_13.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openflow_13.proto
deleted file mode 100644
index 2a0eec2..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openflow_13.proto
+++ /dev/null
@@ -1,2310 +0,0 @@
-/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford
- * Junior University
- * Copyright (c) 2011, 2012 Open Networking Foundation
- *
- * We are making the OpenFlow specification and associated documentation
- * (Software) available for public use and benefit with the expectation
- * that others will use, modify and enhance the Software and contribute
- * those enhancements back to the community. However, since we would
- * like to make the Software available for broadest use, with as few
- * restrictions as possible permission is hereby granted, free of
- * charge, to any person obtaining a copy of this Software to deal in
- * the Software under the copyrights without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * The name and trademarks of copyright holder(s) may NOT be used in
- * advertising or publicity pertaining to the Software or any
- * derivatives without specific, written prior permission.
- */
-
-/* OpenFlow: protocol between controller and datapath. */
-
-/*
- * This is a relatively straightforward rendering of OpenFlow message
- * definitions into protocol buffer messages. We preserved the snake
- * case syntax, and made the following changes:
- * - all pad fields dropped
- * - for each enum value above 0x7fffffff the MSB is dropped. For example,
- *   0xffffffff is now 0x7fffffff.
- * - '<type> thing[...]' is replaced with 'repeated <type> thing'
- * - 'char thing[...]' is replaced with 'string thing'
- * - 'uint8_t data[...]' is replaced with 'bytes data'
- * - the following systematic changes are done to various integer types:
- *   uint8_t  -> uint32
- *   uint16_t -> uint32
- *   uint32_t -> uint32
- *   uint64_t -> uint64
- * - removed most length, len, size fields where these values can be determined
- *   from the explicitly encoded length of "repeated" protobuf fields.
- * - explicit use of enum types whereever it is unambigous (and not used as
- *   bitmask/flags value.
- *
- */
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/openflow_13";
-
-package openflow_13;
-
-import "google/api/annotations.proto";
-import public "voltha_protos/yang_options.proto";
-
-
-/* Version number:
- * OpenFlow versions released: 0x01 = 1.0 ; 0x02 = 1.1 ; 0x03 = 1.2
- *     0x04 = 1.3
- */
-/* The most significant bit in the version field is reserved and must
- * be set to zero.
- */
-//#define OFP_VERSION   0x04
-//#define PIPELINE_TABLES 64
-//#define OFP_MAX_TABLE_NAME_LEN 32
-//#define OFP_MAX_PORT_NAME_LEN  16
-/* Official IANA registered port for OpenFlow. */
-//#define OFP_TCP_PORT  6653
-//#define OFP_SSL_PORT  6653
-
-//#define OFP_ETH_ALEN 6          /* Bytes in an Ethernet address. */
-
-/* Port numbering. Ports are numbered starting from 1. */
-enum ofp_port_no {
-    OFPP_INVALID    = 0;
-
-    /* Maximum number of physical and logical switch ports. */
-    OFPP_MAX        = 0x7fffff00;
-
-    /* Reserved OpenFlow Port (fake output "ports"). */
-    OFPP_IN_PORT    = 0x7ffffff8;  /* Send the packet out the input port.  This
-                                      reserved port must be explicitly used
-                                      in order to send back out of the input
-                                      port. */
-    OFPP_TABLE      = 0x7ffffff9;  /* Submit the packet to the first flow table
-                                      NB: This destination port can only be
-                                      used in packet-out messages. */
-    OFPP_NORMAL     = 0x7ffffffa;  /* Forward using non-OpenFlow pipeline. */
-    OFPP_FLOOD      = 0x7ffffffb;  /* Flood using non-OpenFlow pipeline. */
-    OFPP_ALL        = 0x7ffffffc;  /* All standard ports except input port. */
-    OFPP_CONTROLLER = 0x7ffffffd;  /* Send to controller. */
-    OFPP_LOCAL      = 0x7ffffffe;  /* Local openflow "port". */
-    OFPP_ANY        = 0x7fffffff;  /* Special value used in some requests when
-                                      no port is specified (i.e. wildcarded).*/
-};
-
-enum ofp_type {
-
-    /* Immutable messages. */
-    OFPT_HELLO                      = 0;  /* Symmetric message */
-    OFPT_ERROR                      = 1;  /* Symmetric message */
-    OFPT_ECHO_REQUEST               = 2;  /* Symmetric message */
-    OFPT_ECHO_REPLY                 = 3;  /* Symmetric message */
-    OFPT_EXPERIMENTER               = 4;  /* Symmetric message */
-
-    /* Switch configuration messages. */
-    OFPT_FEATURES_REQUEST           = 5;  /* Controller/switch message */
-    OFPT_FEATURES_REPLY             = 6;  /* Controller/switch message */
-    OFPT_GET_CONFIG_REQUEST         = 7;  /* Controller/switch message */
-    OFPT_GET_CONFIG_REPLY           = 8;  /* Controller/switch message */
-    OFPT_SET_CONFIG                 = 9;  /* Controller/switch message */
-
-    /* Asynchronous messages. */
-    OFPT_PACKET_IN                  = 10; /* Async message */
-    OFPT_FLOW_REMOVED               = 11; /* Async message */
-    OFPT_PORT_STATUS                = 12; /* Async message */
-
-    /* Controller command messages. */
-    OFPT_PACKET_OUT                 = 13; /* Controller/switch message */
-    OFPT_FLOW_MOD                   = 14; /* Controller/switch message */
-    OFPT_GROUP_MOD                  = 15; /* Controller/switch message */
-    OFPT_PORT_MOD                   = 16; /* Controller/switch message */
-    OFPT_TABLE_MOD                  = 17; /* Controller/switch message */
-
-    /* Multipart messages. */
-    OFPT_MULTIPART_REQUEST          = 18; /* Controller/switch message */
-    OFPT_MULTIPART_REPLY            = 19; /* Controller/switch message */
-
-    /* Barrier messages. */
-    OFPT_BARRIER_REQUEST            = 20; /* Controller/switch message */
-    OFPT_BARRIER_REPLY              = 21; /* Controller/switch message */
-
-    /* Queue Configuration messages. */
-    OFPT_QUEUE_GET_CONFIG_REQUEST   = 22;  /* Controller/switch message */
-    OFPT_QUEUE_GET_CONFIG_REPLY     = 23;  /* Controller/switch message */
-
-    /* Controller role change request messages. */
-    OFPT_ROLE_REQUEST               = 24; /* Controller/switch message */
-    OFPT_ROLE_REPLY                 = 25; /* Controller/switch message */
-
-    /* Asynchronous message configuration. */
-    OFPT_GET_ASYNC_REQUEST          = 26; /* Controller/switch message */
-    OFPT_GET_ASYNC_REPLY            = 27; /* Controller/switch message */
-    OFPT_SET_ASYNC                  = 28; /* Controller/switch message */
-
-    /* Meters and rate limiters configuration messages. */
-    OFPT_METER_MOD                  = 29; /* Controller/switch message */
-};
-
-/* Header on all OpenFlow packets. */
-message ofp_header {
-    uint32 version = 1;    /* OFP_VERSION. */
-    ofp_type type = 2;     /* One of the OFPT_ constants. */
-    uint32 xid = 3;        /* Transaction id associated with this packet.
-                              Replies use the same id as was in the request
-                              to facilitate pairing. */
-};
-
-/* Hello elements types.
- */
-enum ofp_hello_elem_type {
-    OFPHET_INVALID                = 0;
-    OFPHET_VERSIONBITMAP          = 1;  /* Bitmap of version supported. */
-};
-
-/* Common header for all Hello Elements */
-message ofp_hello_elem_header {
-    ofp_hello_elem_type type = 1;       /* One of OFPHET_*. */
-    oneof element {
-        ofp_hello_elem_versionbitmap versionbitmap = 2;
-    }
-};
-
-/* Version bitmap Hello Element */
-message ofp_hello_elem_versionbitmap {
-    repeated uint32 bitmaps = 2;   /* List of bitmaps - supported versions */
-};
-
-/* OFPT_HELLO.  This message includes zero or more hello elements having
- * variable size. Unknown elements types must be ignored/skipped, to allow
- * for future extensions. */
-message ofp_hello {
-    //ofp_header header;
-    /* Hello element list */
-    repeated ofp_hello_elem_header elements = 1; /* 0 or more */
-};
-
-//#define OFP_DEFAULT_MISS_SEND_LEN   128
-
-enum ofp_config_flags {
-    /* Handling of IP fragments. */
-    OFPC_FRAG_NORMAL   = 0;       /* No special handling for fragments. */
-    OFPC_FRAG_DROP     = 1;       /* Drop fragments. */
-    OFPC_FRAG_REASM    = 2;       /* Reassemble (only if OFPC_IP_REASM set). */
-    OFPC_FRAG_MASK     = 3;       /* Bitmask of flags dealing with frag. */
-};
-
-/* Switch configuration. */
-message ofp_switch_config {
-    //ofp_header header;
-    uint32 flags = 1;             /* Bitmap of OFPC_* flags. */
-    uint32 miss_send_len = 2;     /* Max bytes of packet that datapath
-                                     should send to the controller. See
-                                     ofp_controller_max_len for valid values.
-                                   */
-};
-
-/* Flags to configure the table. Reserved for future use. */
-enum ofp_table_config {
-    OFPTC_INVALID = 0;
-    OFPTC_DEPRECATED_MASK = 3;     /* Deprecated bits */
-};
-
-/* Table numbering. Tables can use any number up to OFPT_MAX. */
-enum ofp_table {
-
-    OFPTT_INVALID = 0;
-
-    /* Last usable table number. */
-    OFPTT_MAX        = 0xfe;
-
-    /* Fake tables. */
-    OFPTT_ALL        = 0xff;   /* Wildcard table used for table config,
-                                  flow stats and flow deletes. */
-};
-
-
-/* Configure/Modify behavior of a flow table */
-message ofp_table_mod {
-    //ofp_header header;
-    uint32 table_id = 1;  /* ID of the table, OFPTT_ALL indicates all tables */
-    uint32 config = 2;    /* Bitmap of OFPTC_* flags */
-};
-
-/* Capabilities supported by the datapath. */
-enum ofp_capabilities {
-    OFPC_INVALID        = 0;
-    OFPC_FLOW_STATS     = 1;    /* Flow statistics. */
-    OFPC_TABLE_STATS    = 2;    /* Table statistics. */
-    OFPC_PORT_STATS     = 4;    /* Port statistics. */
-    OFPC_GROUP_STATS    = 8;    /* Group statistics. */
-    OFPC_IP_REASM       = 32;   /* Can reassemble IP fragments. */
-    OFPC_QUEUE_STATS    = 64;   /* Queue statistics. */
-    OFPC_PORT_BLOCKED   = 256;  /* Switch will block looping ports. */
-};
-
-/* Flags to indicate behavior of the physical port.  These flags are
- * used in ofp_port to describe the current configuration.  They are
- * used in the ofp_port_mod message to configure the port's behavior.
- */
-enum ofp_port_config {
-    OFPPC_INVALID      = 0;
-    OFPPC_PORT_DOWN    = 1;   /* Port is administratively down. */
-
-    OFPPC_NO_RECV      = 4;   /* Drop all packets received by port. */
-    OFPPC_NO_FWD       = 32;  /* Drop packets forwarded to port. */
-    OFPPC_NO_PACKET_IN = 64;  /* Do not send packet-in msgs for port. */
-};
-
-/* Current state of the physical port.  These are not configurable from
- * the controller.
- */
-enum ofp_port_state {
-    OFPPS_INVALID      = 0;
-    OFPPS_LINK_DOWN    = 1;  /* No physical link present. */
-    OFPPS_BLOCKED      = 2;  /* Port is blocked */
-    OFPPS_LIVE         = 4;  /* Live for Fast Failover Group. */
-};
-
-/* Features of ports available in a datapath. */
-enum ofp_port_features {
-    OFPPF_INVALID    = 0;
-    OFPPF_10MB_HD    = 1;      /* 10 Mb half-duplex rate support. */
-    OFPPF_10MB_FD    = 2;      /* 10 Mb full-duplex rate support. */
-    OFPPF_100MB_HD   = 4;      /* 100 Mb half-duplex rate support. */
-    OFPPF_100MB_FD   = 8;      /* 100 Mb full-duplex rate support. */
-    OFPPF_1GB_HD     = 16;     /* 1 Gb half-duplex rate support. */
-    OFPPF_1GB_FD     = 32;     /* 1 Gb full-duplex rate support. */
-    OFPPF_10GB_FD    = 64;     /* 10 Gb full-duplex rate support. */
-    OFPPF_40GB_FD    = 128;    /* 40 Gb full-duplex rate support. */
-    OFPPF_100GB_FD   = 256;    /* 100 Gb full-duplex rate support. */
-    OFPPF_1TB_FD     = 512;    /* 1 Tb full-duplex rate support. */
-    OFPPF_OTHER      = 1024;   /* Other rate, not in the list. */
-    OFPPF_COPPER     = 2048;   /* Copper medium. */
-    OFPPF_FIBER      = 4096;   /* Fiber medium. */
-    OFPPF_AUTONEG    = 8192;   /* Auto-negotiation. */
-    OFPPF_PAUSE      = 16384;  /* Pause. */
-    OFPPF_PAUSE_ASYM = 32768;  /* Asymmetric pause. */
-};
-
-/* Description of a port */
-message ofp_port {
-    uint32 port_no = 1;
-    repeated uint32 hw_addr = 2; // [OFP_ETH_ALEN];
-    string name = 3;             /* Null-terminated */
-
-    uint32 config = 4;           /* Bitmap of OFPPC_* flags. */
-    uint32 state = 5;            /* Bitmap of OFPPS_* flags. */
-
-    /* Bitmaps of OFPPF_* that describe features.  All bits zeroed if
-     * unsupported or unavailable. */
-    uint32 curr = 6;           /* Current features. */
-    uint32 advertised = 7;     /* Features being advertised by the port. */
-    uint32 supported = 8;      /* Features supported by the port. */
-    uint32 peer = 9;           /* Features advertised by peer. */
-    uint32 curr_speed = 10;    /* Current port bitrate in kbps. */
-    uint32 max_speed = 11;     /* Max port bitrate in kbps */
-};
-
-/* Switch features. */
-message ofp_switch_features {
-    //ofp_header header;
-    uint64 datapath_id = 1;   /* Datapath unique ID.  The lower 48-bits are for
-                                 a MAC address, while the upper 16-bits are
-                                 implementer-defined. */
-
-    uint32 n_buffers = 2;     /* Max packets buffered at once. */
-
-    uint32 n_tables = 3;      /* Number of tables supported by datapath. */
-    uint32 auxiliary_id = 4;  /* Identify auxiliary connections */
-
-    /* Features. */
-    uint32 capabilities = 5;  /* Bitmap of support "ofp_capabilities". */
-};
-
-/* What changed about the physical port */
-enum ofp_port_reason {
-    OFPPR_ADD     = 0;         /* The port was added. */
-    OFPPR_DELETE  = 1;         /* The port was removed. */
-    OFPPR_MODIFY  = 2;         /* Some attribute of the port has changed. */
-};
-
-/* A physical port has changed in the datapath */
-message ofp_port_status {
-    //ofp_header header;
-    ofp_port_reason reason = 1; /* One of OFPPR_*. */
-    ofp_port desc = 2;
-};
-
-/* Modify behavior of the physical port */
-message ofp_port_mod {
-    //ofp_header header;
-    uint32 port_no = 1;
-    repeated uint32 hw_addr = 2; //[OFP_ETH_ALEN];
-                                      /* The hardware address is not
-                                         configurable.  This is used to
-                                         sanity-check the request, so it must
-                                         be the same as returned in an
-                                         ofp_port struct. */
-    uint32 config = 3;        /* Bitmap of OFPPC_* flags. */
-    uint32 mask = 4;          /* Bitmap of OFPPC_* flags to be changed. */
-
-    uint32 advertise = 5;     /* Bitmap of OFPPF_*.  Zero all bits to prevent
-                                 any action taking place. */
-};
-
-/* ## -------------------------- ## */
-/* ## OpenFlow Extensible Match. ## */
-/* ## -------------------------- ## */
-
-/* The match type indicates the match structure (set of fields that compose the
- * match) in use. The match type is placed in the type field at the beginning
- * of all match structures. The "OpenFlow Extensible Match" type corresponds
- * to OXM TLV format described below and must be supported by all OpenFlow
- * switches. Extensions that define other match types may be published on the
- * ONF wiki. Support for extensions is optional.
- */
-enum ofp_match_type {
-    OFPMT_STANDARD = 0;       /* Deprecated. */
-    OFPMT_OXM      = 1;       /* OpenFlow Extensible Match */
-};
-
-/* Fields to match against flows */
-message ofp_match {
-    ofp_match_type type = 1;         /* One of OFPMT_* */
-    repeated ofp_oxm_field oxm_fields = 2;  /* 0 or more */
-};
-
-/* Components of a OXM TLV header.
- * Those macros are not valid for the experimenter class, macros for the
- * experimenter class will depend on the experimenter header used. */
-//#define OXM_HEADER__(CLASS, FIELD, HASMASK, LENGTH) \
-//    (((CLASS) << 16) | ((FIELD) << 9) | ((HASMASK) << 8) | (LENGTH))
-//#define OXM_HEADER(CLASS, FIELD, LENGTH) \
-//    OXM_HEADER__(CLASS, FIELD, 0, LENGTH)
-//#define OXM_HEADER_W(CLASS, FIELD, LENGTH) \
-//    OXM_HEADER__(CLASS, FIELD, 1, (LENGTH) * 2)
-//#define OXM_CLASS(HEADER) ((HEADER) >> 16)
-//#define OXM_FIELD(HEADER) (((HEADER) >> 9) & 0x7f)
-//#define OXM_TYPE(HEADER) (((HEADER) >> 9) & 0x7fffff)
-//#define OXM_HASMASK(HEADER) (((HEADER) >> 8) & 1)
-//#define OXM_LENGTH(HEADER) ((HEADER) & 0xff)
-//
-//#define OXM_MAKE_WILD_HEADER(HEADER) \
-//    OXM_HEADER_W(OXM_CLASS(HEADER), OXM_FIELD(HEADER), OXM_LENGTH(HEADER))
-
-/* OXM Class IDs.
- * The high order bit differentiate reserved classes from member classes.
- * Classes 0x0000 to 0x7FFF are member classes, allocated by ONF.
- * Classes 0x8000 to 0xFFFE are reserved classes, reserved for standardisation.
- */
-enum ofp_oxm_class {
-    OFPXMC_NXM_0          = 0x0000;    /* Backward compatibility with NXM */
-    OFPXMC_NXM_1          = 0x0001;    /* Backward compatibility with NXM */
-    OFPXMC_OPENFLOW_BASIC = 0x8000;    /* Basic class for OpenFlow */
-    OFPXMC_EXPERIMENTER   = 0xFFFF;    /* Experimenter class */
-};
-
-/* OXM Flow field types for OpenFlow basic class. */
-enum oxm_ofb_field_types {
-    OFPXMT_OFB_IN_PORT        = 0;  /* Switch input port. */
-    OFPXMT_OFB_IN_PHY_PORT    = 1;  /* Switch physical input port. */
-    OFPXMT_OFB_METADATA       = 2;  /* Metadata passed between tables. */
-    OFPXMT_OFB_ETH_DST        = 3;  /* Ethernet destination address. */
-    OFPXMT_OFB_ETH_SRC        = 4;  /* Ethernet source address. */
-    OFPXMT_OFB_ETH_TYPE       = 5;  /* Ethernet frame type. */
-    OFPXMT_OFB_VLAN_VID       = 6;  /* VLAN id. */
-    OFPXMT_OFB_VLAN_PCP       = 7;  /* VLAN priority. */
-    OFPXMT_OFB_IP_DSCP        = 8;  /* IP DSCP (6 bits in ToS field). */
-    OFPXMT_OFB_IP_ECN         = 9;  /* IP ECN (2 bits in ToS field). */
-    OFPXMT_OFB_IP_PROTO       = 10; /* IP protocol. */
-    OFPXMT_OFB_IPV4_SRC       = 11; /* IPv4 source address. */
-    OFPXMT_OFB_IPV4_DST       = 12; /* IPv4 destination address. */
-    OFPXMT_OFB_TCP_SRC        = 13; /* TCP source port. */
-    OFPXMT_OFB_TCP_DST        = 14; /* TCP destination port. */
-    OFPXMT_OFB_UDP_SRC        = 15; /* UDP source port. */
-    OFPXMT_OFB_UDP_DST        = 16; /* UDP destination port. */
-    OFPXMT_OFB_SCTP_SRC       = 17; /* SCTP source port. */
-    OFPXMT_OFB_SCTP_DST       = 18; /* SCTP destination port. */
-    OFPXMT_OFB_ICMPV4_TYPE    = 19; /* ICMP type. */
-    OFPXMT_OFB_ICMPV4_CODE    = 20; /* ICMP code. */
-    OFPXMT_OFB_ARP_OP         = 21; /* ARP opcode. */
-    OFPXMT_OFB_ARP_SPA        = 22; /* ARP source IPv4 address. */
-    OFPXMT_OFB_ARP_TPA        = 23; /* ARP target IPv4 address. */
-    OFPXMT_OFB_ARP_SHA        = 24; /* ARP source hardware address. */
-    OFPXMT_OFB_ARP_THA        = 25; /* ARP target hardware address. */
-    OFPXMT_OFB_IPV6_SRC       = 26; /* IPv6 source address. */
-    OFPXMT_OFB_IPV6_DST       = 27; /* IPv6 destination address. */
-    OFPXMT_OFB_IPV6_FLABEL    = 28; /* IPv6 Flow Label */
-    OFPXMT_OFB_ICMPV6_TYPE    = 29; /* ICMPv6 type. */
-    OFPXMT_OFB_ICMPV6_CODE    = 30; /* ICMPv6 code. */
-    OFPXMT_OFB_IPV6_ND_TARGET = 31; /* Target address for ND. */
-    OFPXMT_OFB_IPV6_ND_SLL    = 32; /* Source link-layer for ND. */
-    OFPXMT_OFB_IPV6_ND_TLL    = 33; /* Target link-layer for ND. */
-    OFPXMT_OFB_MPLS_LABEL     = 34; /* MPLS label. */
-    OFPXMT_OFB_MPLS_TC        = 35; /* MPLS TC. */
-    OFPXMT_OFB_MPLS_BOS       = 36; /* MPLS BoS bit. */
-    OFPXMT_OFB_PBB_ISID       = 37; /* PBB I-SID. */
-    OFPXMT_OFB_TUNNEL_ID      = 38; /* Logical Port Metadata. */
-    OFPXMT_OFB_IPV6_EXTHDR    = 39; /* IPv6 Extension Header pseudo-field */
-};
-
-/* OXM Flow match fields */
-message ofp_oxm_field {
-    ofp_oxm_class oxm_class = 1;
-    oneof field {
-        /* 2 and 3 reserved for NXM_0 and NXM-1 OXM classes */
-        ofp_oxm_ofb_field ofb_field = 4;
-        ofp_oxm_experimenter_field experimenter_field = 5;
-    }
-}
-
-/* OXM OpenFlow Basic Match Field */
-message ofp_oxm_ofb_field {
-    oxm_ofb_field_types type = 1;
-    bool has_mask = 2;
-    oneof value {
-
-        /* OpenFlow port on which the packet was received.
-         * May be a physical port, a logical port, or the reserved port OFPP_LOCAL
-         *
-         * Prereqs: None.
-         *
-         * Format: 32-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IN_PORT    OXM_HEADER  (0x8000, OFPXMT_OFB_IN_PORT, 4)
-        uint32 port = 3; /* Used for OFPXMT_OFB_IN_PORT */
-
-        /* Physical port on which the packet was received.
-         *
-         * Consider a packet received on a tunnel interface defined over a link
-         * aggregation group (LAG) with two physical port members.  If the tunnel
-         * interface is the logical port bound to OpenFlow.  In this case,
-         * OFPXMT_OF_IN_PORT is the tunnel's port number and OFPXMT_OF_IN_PHY_PORT is
-         * the physical port number of the LAG on which the tunnel is configured.
-         *
-         * When a packet is received directly on a physical port and not processed by a
-         * logical port, OFPXMT_OF_IN_PORT and OFPXMT_OF_IN_PHY_PORT have the same
-         * value.
-         *
-         * This field is usually not available in a regular match and only available
-         * in ofp_packet_in messages when it's different from OXM_OF_IN_PORT.
-         *
-         * Prereqs: OXM_OF_IN_PORT must be present.
-         *
-         * Format: 32-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IN_PHY_PORT OXM_HEADER  (0x8000, OFPXMT_OFB_IN_PHY_PORT, 4)
-        uint32 physical_port = 4; /* Used for OFPXMT_OF_IN_PHY_PORT */
-
-        /* Table metadata.
-         *
-         * Prereqs: None.
-         *
-         * Format: 64-bit integer in network byte order.
-         *
-         * Masking: Arbitrary masks.
-         */
-        //#define OXM_OF_METADATA   OXM_HEADER  (0x8000, OFPXMT_OFB_METADATA, 8)
-        //#define OXM_OF_METADATA_W OXM_HEADER_W(0x8000, OFPXMT_OFB_METADATA, 8)
-        uint64 table_metadata = 5; /* Used for OFPXMT_OFB_METADATA */
-
-        /* Source or destination address in Ethernet header.
-         *
-         * Prereqs: None.
-         *
-         * Format: 48-bit Ethernet MAC address.
-         *
-         * Masking: Arbitrary masks. */
-        //#define OXM_OF_ETH_DST    OXM_HEADER  (0x8000, OFPXMT_OFB_ETH_DST, 6)
-        //#define OXM_OF_ETH_DST_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_ETH_DST, 6)
-        //#define OXM_OF_ETH_SRC    OXM_HEADER  (0x8000, OFPXMT_OFB_ETH_SRC, 6)
-        //#define OXM_OF_ETH_SRC_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_ETH_SRC, 6)
-        bytes eth_dst = 6; /* Used for OFPXMT_OFB_ETH_DST (exactly 6 bytes) */
-        bytes eth_src = 7; /* Used for OFPXMT_OFB_ETH_SRC (exactly 6 bytes) */
-
-        /* Packet's Ethernet type.
-         *
-         * Prereqs: None.
-         *
-         * Format: 16-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_ETH_TYPE   OXM_HEADER  (0x8000, OFPXMT_OFB_ETH_TYPE,2)
-        uint32 eth_type = 8; /* Used for OFPXMT_OFB_ETH_TYPE */
-
-        /* 802.1Q VID.
-         *
-         * For a packet with an 802.1Q header, this is the VLAN-ID (VID) from the
-         * outermost tag, with the CFI bit forced to 1. For a packet with no 802.1Q
-         * header, this has value OFPVID_NONE.
-         *
-         * Prereqs: None.
-         *
-         * Format: 16-bit integer in network byte order with bit 13 indicating
-         * presence of VLAN header and 3 most-significant bits forced to 0.
-         * Only the lower 13 bits have meaning.
-         *
-         * Masking: Arbitrary masks.
-         *
-         * This field can be used in various ways:
-         *
-         *   - If it is not constrained at all, the nx_match matches packets without
-         *     an 802.1Q header or with an 802.1Q header that has any VID value.
-         *
-         *   - Testing for an exact match with 0x0 matches only packets without
-         *     an 802.1Q header.
-         *
-         *   - Testing for an exact match with a VID value with CFI=1 matches packets
-         *     that have an 802.1Q header with a specified VID.
-         *
-         *   - Testing for an exact match with a nonzero VID value with CFI=0 does
-         *     not make sense.  The switch may reject this combination.
-         *
-         *   - Testing with nxm_value=0, nxm_mask=0x0fff matches packets with no 802.1Q
-         *     header or with an 802.1Q header with a VID of 0.
-         *
-         *   - Testing with nxm_value=0x1000, nxm_mask=0x1000 matches packets with
-         *     an 802.1Q header that has any VID value.
-         */
-        //#define OXM_OF_VLAN_VID   OXM_HEADER  (0x8000, OFPXMT_OFB_VLAN_VID, 2)
-        //#define OXM_OF_VLAN_VID_W OXM_HEADER_W(0x8000, OFPXMT_OFB_VLAN_VID, 2)
-        uint32 vlan_vid = 9; /* Used for OFPXMT_OFB_VLAN_VID */
-
-        /* 802.1Q PCP.
-         *
-         * For a packet with an 802.1Q header, this is the VLAN-PCP from the
-         * outermost tag.  For a packet with no 802.1Q header, this has value
-         * 0.
-         *
-         * Prereqs: OXM_OF_VLAN_VID must be different from OFPVID_NONE.
-         *
-         * Format: 8-bit integer with 5 most-significant bits forced to 0.
-         * Only the lower 3 bits have meaning.
-         *
-         * Masking: Not maskable.
-         */
-        //#define OXM_OF_VLAN_PCP   OXM_HEADER  (0x8000, OFPXMT_OFB_VLAN_PCP, 1)
-        uint32 vlan_pcp = 10; /* Used for OFPXMT_OFB_VLAN_PCP */
-
-        /* The Diff Serv Code Point (DSCP) bits of the IP header.
-         * Part of the IPv4 ToS field or the IPv6 Traffic Class field.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
-         *
-         * Format: 8-bit integer with 2 most-significant bits forced to 0.
-         * Only the lower 6 bits have meaning.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IP_DSCP     OXM_HEADER  (0x8000, OFPXMT_OFB_IP_DSCP, 1)
-        uint32 ip_dscp = 11; /* Used for OFPXMT_OFB_IP_DSCP */
-
-        /* The ECN bits of the IP header.
-         * Part of the IPv4 ToS field or the IPv6 Traffic Class field.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
-         *
-         * Format: 8-bit integer with 6 most-significant bits forced to 0.
-         * Only the lower 2 bits have meaning.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IP_ECN     OXM_HEADER  (0x8000, OFPXMT_OFB_IP_ECN, 1)
-        uint32 ip_ecn = 12; /* Used for OFPXMT_OFB_IP_ECN */
-
-        /* The "protocol" byte in the IP header.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
-         *
-         * Format: 8-bit integer.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IP_PROTO   OXM_HEADER  (0x8000, OFPXMT_OFB_IP_PROTO, 1)
-        uint32 ip_proto = 13; /* Used for OFPXMT_OFB_IP_PROTO */
-
-        /* The source or destination address in the IP header.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must match 0x0800 exactly.
-         *
-         * Format: 32-bit integer in network byte order.
-         *
-         * Masking: Arbitrary masks.
-         */
-        //#define OXM_OF_IPV4_SRC     OXM_HEADER  (0x8000, OFPXMT_OFB_IPV4_SRC, 4)
-        //#define OXM_OF_IPV4_SRC_W   OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV4_SRC, 4)
-        //#define OXM_OF_IPV4_DST     OXM_HEADER  (0x8000, OFPXMT_OFB_IPV4_DST, 4)
-        //#define OXM_OF_IPV4_DST_W   OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV4_DST, 4)
-        uint32 ipv4_src = 14; /* Used for OFPXMT_OFB_IPV4_SRC */
-        uint32 ipv4_dst = 15; /* Used for OFPXMT_OFB_IPV4_DST */
-
-        /* The source or destination port in the TCP header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must be either 0x0800 or 0x86dd.
-         *   OXM_OF_IP_PROTO must match 6 exactly.
-         *
-         * Format: 16-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_TCP_SRC    OXM_HEADER  (0x8000, OFPXMT_OFB_TCP_SRC, 2)
-        //#define OXM_OF_TCP_DST    OXM_HEADER  (0x8000, OFPXMT_OFB_TCP_DST, 2)
-        uint32 tcp_src = 16; /* Used for OFPXMT_OFB_TCP_SRC */
-        uint32 tcp_dst = 17; /* Used for OFPXMT_OFB_TCP_DST */
-
-        /* The source or destination port in the UDP header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match either 0x0800 or 0x86dd.
-         *   OXM_OF_IP_PROTO must match 17 exactly.
-         *
-         * Format: 16-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_UDP_SRC    OXM_HEADER  (0x8000, OFPXMT_OFB_UDP_SRC, 2)
-        //#define OXM_OF_UDP_DST    OXM_HEADER  (0x8000, OFPXMT_OFB_UDP_DST, 2)
-        uint32 udp_src = 18; /* Used for OFPXMT_OFB_UDP_SRC */
-        uint32 udp_dst = 19; /* Used for OFPXMT_OFB_UDP_DST */
-
-        /* The source or destination port in the SCTP header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match either 0x0800 or 0x86dd.
-         *   OXM_OF_IP_PROTO must match 132 exactly.
-         *
-         * Format: 16-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_SCTP_SRC   OXM_HEADER  (0x8000, OFPXMT_OFB_SCTP_SRC, 2)
-        //#define OXM_OF_SCTP_DST   OXM_HEADER  (0x8000, OFPXMT_OFB_SCTP_DST, 2)
-        uint32 sctp_src = 20; /* Used for OFPXMT_OFB_SCTP_SRC */
-        uint32 sctp_dst = 21; /* Used for OFPXMT_OFB_SCTP_DST */
-
-        /* The type or code in the ICMP header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x0800 exactly.
-         *   OXM_OF_IP_PROTO must match 1 exactly.
-         *
-         * Format: 8-bit integer.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_ICMPV4_TYPE  OXM_HEADER  (0x8000, OFPXMT_OFB_ICMPV4_TYPE, 1)
-        //#define OXM_OF_ICMPV4_CODE  OXM_HEADER  (0x8000, OFPXMT_OFB_ICMPV4_CODE, 1)
-        uint32 icmpv4_type = 22; /* Used for OFPXMT_OFB_ICMPV4_TYPE */
-        uint32 icmpv4_code = 23; /* Used for OFPXMT_OFB_ICMPV4_CODE */
-
-        /* ARP opcode.
-         *
-         * For an Ethernet+IP ARP packet, the opcode in the ARP header.  Always 0
-         * otherwise.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
-         *
-         * Format: 16-bit integer in network byte order.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_ARP_OP     OXM_HEADER  (0x8000, OFPXMT_OFB_ARP_OP, 2)
-        uint32 arp_op = 24; /* Used for OFPXMT_OFB_ARP_OP */
-
-        /* For an Ethernet+IP ARP packet, the source or target protocol address
-         * in the ARP header.  Always 0 otherwise.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
-         *
-         * Format: 32-bit integer in network byte order.
-         *
-         * Masking: Arbitrary masks.
-         */
-        //#define OXM_OF_ARP_SPA    OXM_HEADER  (0x8000, OFPXMT_OFB_ARP_SPA, 4)
-        //#define OXM_OF_ARP_SPA_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_ARP_SPA, 4)
-        //#define OXM_OF_ARP_TPA    OXM_HEADER  (0x8000, OFPXMT_OFB_ARP_TPA, 4)
-        //#define OXM_OF_ARP_TPA_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_ARP_TPA, 4)
-        uint32 arp_spa = 25; /* For OFPXMT_OFB_ARP_SPA */
-        uint32 arp_tpa = 26; /* For OFPXMT_OFB_ARP_TPA */
-
-        /* For an Ethernet+IP ARP packet, the source or target hardware address
-         * in the ARP header.  Always 0 otherwise.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must match 0x0806 exactly.
-         *
-         * Format: 48-bit Ethernet MAC address.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_ARP_SHA    OXM_HEADER   (0x8000, OFPXMT_OFB_ARP_SHA, 6)
-        //#define OXM_OF_ARP_SHA_W  OXM_HEADER_W (0x8000, OFPXMT_OFB_ARP_SHA, 6)
-        //#define OXM_OF_ARP_THA    OXM_HEADER   (0x8000, OFPXMT_OFB_ARP_THA, 6)
-        //#define OXM_OF_ARP_THA_W  OXM_HEADER_W (0x8000, OFPXMT_OFB_ARP_THA, 6)
-        bytes arp_sha = 27; /* For OFPXMT_OFB_ARP_SHA (6 bytes) */
-        bytes arp_tha = 28; /* For OFPXMT_OFB_ARP_THA (6 bytes) */
-
-        /* The source or destination address in the IPv6 header.
-         *
-         * Prereqs: OXM_OF_ETH_TYPE must match 0x86dd exactly.
-         *
-         * Format: 128-bit IPv6 address.
-         *
-         * Masking: Arbitrary masks.
-         */
-        //#define OXM_OF_IPV6_SRC    OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_SRC, 16)
-        //#define OXM_OF_IPV6_SRC_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV6_SRC, 16)
-        //#define OXM_OF_IPV6_DST    OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_DST, 16)
-        //#define OXM_OF_IPV6_DST_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV6_DST, 16)
-        bytes ipv6_src = 29; /* For OFPXMT_OFB_IPV6_SRC */
-        bytes ipv6_dst = 30; /* For OFPXMT_OFB_IPV6_DST */
-
-        /* The IPv6 Flow Label
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly
-         *
-         * Format: 32-bit integer with 12 most-significant bits forced to 0.
-         * Only the lower 20 bits have meaning.
-         *
-         * Masking: Arbitrary masks.
-         */
-        //#define OXM_OF_IPV6_FLABEL   OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_FLABEL, 4)
-        //#define OXM_OF_IPV6_FLABEL_W OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV6_FLABEL, 4)
-        uint32 ipv6_flabel = 31; /* For OFPXMT_OFB_IPV6_FLABEL */
-
-        /* The type or code in the ICMPv6 header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
-         *   OXM_OF_IP_PROTO must match 58 exactly.
-         *
-         * Format: 8-bit integer.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_ICMPV6_TYPE OXM_HEADER  (0x8000, OFPXMT_OFB_ICMPV6_TYPE, 1)
-        //#define OXM_OF_ICMPV6_CODE OXM_HEADER  (0x8000, OFPXMT_OFB_ICMPV6_CODE, 1)
-        uint32 icmpv6_type = 32; /* For OFPXMT_OFB_ICMPV6_TYPE */
-        uint32 icmpv6_code = 33; /* For OFPXMT_OFB_ICMPV6_CODE */
-
-        /* The target address in an IPv6 Neighbor Discovery message.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
-         *   OXM_OF_IP_PROTO must match 58 exactly.
-         *   OXM_OF_ICMPV6_TYPE must be either 135 or 136.
-         *
-         * Format: 128-bit IPv6 address.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IPV6_ND_TARGET OXM_HEADER \
-        //    (0x8000, OFPXMT_OFB_IPV6_ND_TARGET, 16)
-        bytes ipv6_nd_target = 34; /* For OFPXMT_OFB_IPV6_ND_TARGET */
-
-        /* The source link-layer address option in an IPv6 Neighbor Discovery
-         * message.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
-         *   OXM_OF_IP_PROTO must match 58 exactly.
-         *   OXM_OF_ICMPV6_TYPE must be exactly 135.
-         *
-         * Format: 48-bit Ethernet MAC address.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IPV6_ND_SLL  OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_ND_SLL, 6)
-        bytes ipv6_nd_ssl = 35; /* For OFPXMT_OFB_IPV6_ND_SLL */
-
-        /* The target link-layer address option in an IPv6 Neighbor Discovery
-         * message.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly.
-         *   OXM_OF_IP_PROTO must match 58 exactly.
-         *   OXM_OF_ICMPV6_TYPE must be exactly 136.
-         *
-         * Format: 48-bit Ethernet MAC address.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_IPV6_ND_TLL  OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_ND_TLL, 6)
-        bytes ipv6_nd_tll = 36; /* For OFPXMT_OFB_IPV6_ND_TLL */
-
-        /* The LABEL in the first MPLS shim header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x8847 or 0x8848 exactly.
-         *
-         * Format: 32-bit integer in network byte order with 12 most-significant
-         * bits forced to 0. Only the lower 20 bits have meaning.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_MPLS_LABEL  OXM_HEADER  (0x8000, OFPXMT_OFB_MPLS_LABEL, 4)
-        uint32 mpls_label = 37; /* For OFPXMT_OFB_MPLS_LABEL */
-
-        /* The TC in the first MPLS shim header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x8847 or 0x8848 exactly.
-         *
-         * Format: 8-bit integer with 5 most-significant bits forced to 0.
-         * Only the lower 3 bits have meaning.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_MPLS_TC     OXM_HEADER  (0x8000, OFPXMT_OFB_MPLS_TC, 1)
-        uint32 mpls_tc = 38; /* For OFPXMT_OFB_MPLS_TC */
-
-        /* The BoS bit in the first MPLS shim header.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x8847 or 0x8848 exactly.
-         *
-         * Format: 8-bit integer with 7 most-significant bits forced to 0.
-         * Only the lowest bit have a meaning.
-         *
-         * Masking: Not maskable. */
-        //#define OXM_OF_MPLS_BOS     OXM_HEADER  (0x8000, OFPXMT_OFB_MPLS_BOS, 1)
-        uint32 mpls_bos = 39; /* For OFPXMT_OFB_MPLS_BOS */
-
-        /* IEEE 802.1ah I-SID.
-         *
-         * For a packet with a PBB header, this is the I-SID from the
-         * outermost service tag.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x88E7 exactly.
-         *
-         * Format: 24-bit integer in network byte order.
-         *
-         * Masking: Arbitrary masks. */
-        //#define OXM_OF_PBB_ISID   OXM_HEADER  (0x8000, OFPXMT_OFB_PBB_ISID, 3)
-        //#define OXM_OF_PBB_ISID_W OXM_HEADER_W(0x8000, OFPXMT_OFB_PBB_ISID, 3)
-        uint32 pbb_isid = 40; /* For OFPXMT_OFB_PBB_ISID */
-
-        /* Logical Port Metadata.
-         *
-         * Metadata associated with a logical port.
-         * If the logical port performs encapsulation and decapsulation, this
-         * is the demultiplexing field from the encapsulation header.
-         * For example, for a packet received via GRE tunnel including a (32-bit) key,
-         * the key is stored in the low 32-bits and the high bits are zeroed.
-         * For a MPLS logical port, the low 20 bits represent the MPLS Label.
-         * For a VxLAN logical port, the low 24 bits represent the VNI.
-         * If the packet is not received through a logical port, the value is 0.
-         *
-         * Prereqs: None.
-         *
-         * Format: 64-bit integer in network byte order.
-         *
-         * Masking: Arbitrary masks. */
-        //#define OXM_OF_TUNNEL_ID    OXM_HEADER  (0x8000, OFPXMT_OFB_TUNNEL_ID, 8)
-        //#define OXM_OF_TUNNEL_ID_W  OXM_HEADER_W(0x8000, OFPXMT_OFB_TUNNEL_ID, 8)
-        uint64 tunnel_id = 41; /* For OFPXMT_OFB_TUNNEL_ID */
-
-        /* The IPv6 Extension Header pseudo-field.
-         *
-         * Prereqs:
-         *   OXM_OF_ETH_TYPE must match 0x86dd exactly
-         *
-         * Format: 16-bit integer with 7 most-significant bits forced to 0.
-         * Only the lower 9 bits have meaning.
-         *
-         * Masking: Maskable. */
-        //#define OXM_OF_IPV6_EXTHDR   OXM_HEADER  (0x8000, OFPXMT_OFB_IPV6_EXTHDR, 2)
-        //#define OXM_OF_IPV6_EXTHDR_W OXM_HEADER_W(0x8000, OFPXMT_OFB_IPV6_EXTHDR, 2)
-        uint32 ipv6_exthdr = 42; /* For OFPXMT_OFB_IPV6_EXTHDR */
-
-    }
-
-    /* Optional mask values (must be present when has_mask is true */
-    oneof mask {
-        uint64 table_metadata_mask = 105; /* For OFPXMT_OFB_METADATA */
-
-        bytes eth_dst_mask = 106; /* For OFPXMT_OFB_ETH_DST (exactly 6 bytes)*/
-        bytes eth_src_mask = 107; /* For OFPXMT_OFB_ETH_SRC (exactly 6 bytes)*/
-
-        uint32 vlan_vid_mask = 109; /* For OFPXMT_OFB_VLAN_VID */
-
-        uint32 ipv4_src_mask = 114; /* For OFPXMT_OFB_IPV4_SRC */
-        uint32 ipv4_dst_mask = 115; /* For OFPXMT_OFB_IPV4_DST */
-
-        uint32 arp_spa_mask = 125; /* For OFPXMT_OFB_ARP_SPA */
-        uint32 arp_tpa_mask = 126; /* For OFPXMT_OFB_ARP_TPA */
-
-        bytes ipv6_src_mask = 129; /* For OFPXMT_OFB_IPV6_SRC */
-        bytes ipv6_dst_mask = 130; /* For OFPXMT_OFB_IPV6_DST */
-
-        uint32 ipv6_flabel_mask = 131; /* For OFPXMT_OFB_IPV6_FLABEL */
-
-        uint32 pbb_isid_mask = 140; /* For OFPXMT_OFB_PBB_ISID */
-
-        uint64 tunnel_id_mask = 141; /* For OFPXMT_OFB_TUNNEL_ID */
-
-        uint32 ipv6_exthdr_mask = 142; /* For OFPXMT_OFB_IPV6_EXTHDR */
-    }
-
-}
-//#define OFPXMT_OFB_ALL    ((UINT64_C(1) << 40) - 1)
-
-
-/* The VLAN id is 12-bits, so we can use the entire 16 bits to indicate
- * special conditions.
- */
-enum ofp_vlan_id {
-    OFPVID_NONE    = 0x0000; /* No VLAN id was set. */
-    OFPVID_PRESENT = 0x1000; /* Bit that indicate that a VLAN id is set */
-};
-/* Define for compatibility */
-//#define OFP_VLAN_NONE      OFPVID_NONE
-
-/* Bit definitions for IPv6 Extension Header pseudo-field. */
-enum ofp_ipv6exthdr_flags {
-    OFPIEH_INVALID = 0;
-    OFPIEH_NONEXT  = 1;     /* "No next header" encountered. */
-    OFPIEH_ESP     = 2;     /* Encrypted Sec Payload header present. */
-    OFPIEH_AUTH    = 4;     /* Authentication header present. */
-    OFPIEH_DEST    = 8;     /* 1 or 2 dest headers present. */
-    OFPIEH_FRAG    = 16;    /* Fragment header present. */
-    OFPIEH_ROUTER  = 32;    /* Router header present. */
-    OFPIEH_HOP     = 64;    /* Hop-by-hop header present. */
-    OFPIEH_UNREP   = 128;   /* Unexpected repeats encountered. */
-    OFPIEH_UNSEQ   = 256;   /* Unexpected sequencing encountered. */
-};
-
-/* Header for OXM experimenter match fields.
- * The experimenter class should not use OXM_HEADER() macros for defining
- * fields due to this extra header. */
-message ofp_oxm_experimenter_field {
-    uint32 oxm_header = 1;    /* oxm_class = OFPXMC_EXPERIMENTER */
-    uint32 experimenter = 2;  /* Experimenter ID which takes the same
-                                 form as in struct ofp_experimenter_header. */
-};
-
-/* ## ----------------- ## */
-/* ## OpenFlow Actions. ## */
-/* ## ----------------- ## */
-
-enum ofp_action_type {
-    OFPAT_OUTPUT       = 0;  /* Output to switch port. */
-    OFPAT_COPY_TTL_OUT = 11; /* Copy TTL "outwards" -- from next-to-outermost
-                                to outermost */
-    OFPAT_COPY_TTL_IN  = 12; /* Copy TTL "inwards" -- from outermost to
-                               next-to-outermost */
-    OFPAT_SET_MPLS_TTL = 15; /* MPLS TTL */
-    OFPAT_DEC_MPLS_TTL = 16; /* Decrement MPLS TTL */
-
-    OFPAT_PUSH_VLAN    = 17; /* Push a new VLAN tag */
-    OFPAT_POP_VLAN     = 18; /* Pop the outer VLAN tag */
-    OFPAT_PUSH_MPLS    = 19; /* Push a new MPLS tag */
-    OFPAT_POP_MPLS     = 20; /* Pop the outer MPLS tag */
-    OFPAT_SET_QUEUE    = 21; /* Set queue id when outputting to a port */
-    OFPAT_GROUP        = 22; /* Apply group. */
-    OFPAT_SET_NW_TTL   = 23; /* IP TTL. */
-    OFPAT_DEC_NW_TTL   = 24; /* Decrement IP TTL. */
-    OFPAT_SET_FIELD    = 25; /* Set a header field using OXM TLV format. */
-    OFPAT_PUSH_PBB     = 26; /* Push a new PBB service tag (I-TAG) */
-    OFPAT_POP_PBB      = 27; /* Pop the outer PBB service tag (I-TAG) */
-    OFPAT_EXPERIMENTER = 0xffff;
-};
-
-/* Action header that is common to all actions.  The length includes the
- * header and any padding used to make the action 64-bit aligned.
- * NB: The length of an action *must* always be a multiple of eight. */
-message ofp_action {
-    ofp_action_type type = 1;       /* One of OFPAT_*. */
-    oneof action {
-        ofp_action_output output = 2;
-        ofp_action_mpls_ttl mpls_ttl = 3;
-        ofp_action_push push = 4;
-        ofp_action_pop_mpls pop_mpls = 5;
-        ofp_action_group group = 6;
-        ofp_action_nw_ttl nw_ttl = 7;
-        ofp_action_set_field set_field = 8;
-        ofp_action_experimenter experimenter = 9;
-    }
-};
-
-enum ofp_controller_max_len {
-    OFPCML_INVALID   = 0;
-    OFPCML_MAX       = 0xffe5; /* maximum max_len value which can be used
-                                  to request a specific byte length. */
-    OFPCML_NO_BUFFER = 0xffff; /* indicates that no buffering should be
-                                  applied and the whole packet is to be
-                                  sent to the controller. */
-};
-
-/* Action structure for OFPAT_OUTPUT, which sends packets out 'port'.
- * When the 'port' is the OFPP_CONTROLLER, 'max_len' indicates the max
- * number of bytes to send.  A 'max_len' of zero means no bytes of the
- * packet should be sent. A 'max_len' of OFPCML_NO_BUFFER means that
- * the packet is not buffered and the complete packet is to be sent to
- * the controller. */
-message ofp_action_output {
-    uint32 port = 1;                 /* Output port. */
-    uint32 max_len = 2;              /* Max length to send to controller. */
-};
-
-/* Action structure for OFPAT_SET_MPLS_TTL. */
-message ofp_action_mpls_ttl {
-    uint32 mpls_ttl = 1;             /* MPLS TTL */
-};
-
-/* Action structure for OFPAT_PUSH_VLAN/MPLS/PBB. */
-message ofp_action_push {
-    uint32 ethertype = 1;            /* Ethertype */
-};
-
-/* Action structure for OFPAT_POP_MPLS. */
-message ofp_action_pop_mpls {
-    uint32 ethertype = 1;            /* Ethertype */
-};
-
-/* Action structure for OFPAT_GROUP. */
-message ofp_action_group {
-    uint32 group_id = 1;             /* Group identifier. */
-};
-
-/* Action structure for OFPAT_SET_NW_TTL. */
-message ofp_action_nw_ttl {
-    uint32 nw_ttl = 1;               /* IP TTL */
-};
-
-/* Action structure for OFPAT_SET_FIELD. */
-message ofp_action_set_field {
-    ofp_oxm_field field = 1;
-};
-
-/* Action header for OFPAT_EXPERIMENTER.
- * The rest of the body is experimenter-defined. */
-message ofp_action_experimenter {
-    uint32 experimenter = 1;         /* Experimenter ID which takes the same
-                                        form as in struct
-                                        ofp_experimenter_header. */
-    bytes data = 2;
-};
-
-/* ## ---------------------- ## */
-/* ## OpenFlow Instructions. ## */
-/* ## ---------------------- ## */
-
-enum ofp_instruction_type {
-    OFPIT_INVALID    = 0;
-    OFPIT_GOTO_TABLE = 1;       /* Setup the next table in the lookup
-                                   pipeline */
-    OFPIT_WRITE_METADATA = 2;   /* Setup the metadata field for use later in
-                                   pipeline */
-    OFPIT_WRITE_ACTIONS = 3;    /* Write the action(s) onto the datapath action
-                                   set */
-    OFPIT_APPLY_ACTIONS = 4;    /* Applies the action(s) immediately */
-    OFPIT_CLEAR_ACTIONS = 5;    /* Clears all actions from the datapath
-                                   action set */
-    OFPIT_METER = 6;            /* Apply meter (rate limiter) */
-
-    OFPIT_EXPERIMENTER = 0xFFFF; /* Experimenter instruction */
-};
-
-/* Instruction header that is common to all instructions.  The length includes
- * the header and any padding used to make the instruction 64-bit aligned.
- * NB: The length of an instruction *must* always be a multiple of eight. */
-message ofp_instruction {
-    uint32 type = 1;               /* Instruction type */
-    oneof data {
-        ofp_instruction_goto_table goto_table = 2;
-        ofp_instruction_write_metadata write_metadata = 3;
-        ofp_instruction_actions actions = 4;
-        ofp_instruction_meter meter = 5;
-        ofp_instruction_experimenter experimenter = 6;
-    }
-};
-
-/* Instruction structure for OFPIT_GOTO_TABLE */
-message ofp_instruction_goto_table {
-    uint32 table_id = 1;           /* Set next table in the lookup pipeline */
-};
-
-/* Instruction structure for OFPIT_WRITE_METADATA */
-message ofp_instruction_write_metadata {
-    uint64 metadata = 1;           /* Metadata value to write */
-    uint64 metadata_mask = 2;      /* Metadata write bitmask */
-};
-
-/* Instruction structure for OFPIT_WRITE/APPLY/CLEAR_ACTIONS */
-message ofp_instruction_actions {
-    repeated ofp_action actions = 1; /* 0 or more actions associated
-                                        with OFPIT_WRITE_ACTIONS and
-                                        OFPIT_APPLY_ACTIONS */
-};
-
-/* Instruction structure for OFPIT_METER */
-message ofp_instruction_meter {
-    uint32 meter_id = 1;           /* Meter instance. */
-};
-
-/* Instruction structure for experimental instructions */
-message ofp_instruction_experimenter {
-    uint32 experimenter = 1;     /* Experimenter ID which takes the same form
-                                   as in struct ofp_experimenter_header. */
-    /* Experimenter-defined arbitrary additional data. */
-    bytes data = 2;
-};
-
-/* ## --------------------------- ## */
-/* ## OpenFlow Flow Modification. ## */
-/* ## --------------------------- ## */
-
-enum ofp_flow_mod_command {
-    OFPFC_ADD           = 0; /* New flow. */
-    OFPFC_MODIFY        = 1; /* Modify all matching flows. */
-    OFPFC_MODIFY_STRICT = 2; /* Modify entry strictly matching wildcards and
-                                priority. */
-    OFPFC_DELETE        = 3; /* Delete all matching flows. */
-    OFPFC_DELETE_STRICT = 4; /* Delete entry strictly matching wildcards and
-                                priority. */
-};
-
-/* Value used in "idle_timeout" and "hard_timeout" to indicate that the entry
- * is permanent. */
-//#define OFP_FLOW_PERMANENT 0
-
-/* By default, choose a priority in the middle. */
-//#define OFP_DEFAULT_PRIORITY 0x8000
-
-enum ofp_flow_mod_flags {
-    OFPFF_INVALID       = 0;
-    OFPFF_SEND_FLOW_REM = 1;  /* Send flow removed message when flow
-                               * expires or is deleted. */
-    OFPFF_CHECK_OVERLAP = 2;  /* Check for overlapping entries first. */
-    OFPFF_RESET_COUNTS  = 4;  /* Reset flow packet and byte counts. */
-    OFPFF_NO_PKT_COUNTS = 8;  /* Don't keep track of packet count. */
-    OFPFF_NO_BYT_COUNTS = 16; /* Don't keep track of byte count. */
-};
-
-/* Flow setup and teardown (controller -> datapath). */
-message ofp_flow_mod {
-    //ofp_header header;
-    uint64 cookie = 1;             /* Opaque controller-issued identifier. */
-    uint64 cookie_mask = 2;        /* Mask used to restrict the cookie bits
-                                      that must match when the command is
-                                      OFPFC_MODIFY* or OFPFC_DELETE*. A value
-                                      of 0 indicates no restriction. */
-    uint32 table_id = 3;           /* ID of the table to put the flow in.
-                                      For OFPFC_DELETE_* commands, OFPTT_ALL
-                                      can also be used to delete matching
-                                      flows from all tables. */
-    ofp_flow_mod_command command = 4; /* One of OFPFC_*. */
-    uint32 idle_timeout = 5;       /* Idle time before discarding (seconds). */
-    uint32 hard_timeout = 6;       /* Max time before discarding (seconds). */
-    uint32 priority = 7;           /* Priority level of flow entry. */
-    uint32 buffer_id = 8;          /* Buffered packet to apply to, or
-                                      OFP_NO_BUFFER.
-                                      Not meaningful for OFPFC_DELETE*. */
-    uint32 out_port = 9;          /* For OFPFC_DELETE* commands, require
-                                      matching entries to include this as an
-                                      output port.  A value of OFPP_ANY
-                                      indicates no restriction. */
-    uint32 out_group = 10;         /* For OFPFC_DELETE* commands, require
-                                      matching entries to include this as an
-                                      output group.  A value of OFPG_ANY
-                                      indicates no restriction. */
-    uint32 flags = 11;             /* Bitmap of OFPFF_* flags. */
-    ofp_match match = 12;          /* Fields to match. Variable size. */
-    repeated ofp_instruction instructions = 13; /* 0 or more. */
-};
-
-/* Group numbering. Groups can use any number up to OFPG_MAX. */
-enum ofp_group {
-
-    OFPG_INVALID = 0;
-
-    /* Last usable group number. */
-    OFPG_MAX        = 0x7fffff00;
-
-    /* Fake groups. */
-    OFPG_ALL        = 0x7ffffffc;  /* Represents all groups for group delete
-                                      commands. */
-    OFPG_ANY        = 0x7fffffff;  /* Special wildcard: no group specified. */
-};
-
-/* Group commands */
-enum ofp_group_mod_command {
-    OFPGC_ADD    = 0;       /* New group. */
-    OFPGC_MODIFY = 1;       /* Modify all matching groups. */
-    OFPGC_DELETE = 2;       /* Delete all matching groups. */
-};
-
-/* Bucket for use in groups. */
-message ofp_bucket {
-    uint32 weight = 1;              /* Relative weight of bucket.  Only
-                                       defined for select groups. */
-    uint32 watch_port = 2;          /* Port whose state affects whether this
-                                       bucket is live.  Only required for fast
-                                       failover groups. */
-    uint32 watch_group = 3;         /* Group whose state affects whether this
-                                       bucket is live.  Only required for fast
-                                       failover groups. */
-    repeated ofp_action actions = 4;
-};
-
-/* Group setup and teardown (controller -> datapath). */
-message ofp_group_mod {
-    //ofp_header header;
-    ofp_group_mod_command command = 1; /* One of OFPGC_*. */
-    ofp_group_type type = 2;           /* One of OFPGT_*. */
-    uint32 group_id = 3;               /* Group identifier. */
-    repeated ofp_bucket buckets = 4;
-};
-
-/* Group types.  Values in the range [128; 255] are reserved for experimental
- * use. */
-enum ofp_group_type {
-    OFPGT_ALL      = 0; /* All (multicast/broadcast) group.  */
-    OFPGT_SELECT   = 1; /* Select group. */
-    OFPGT_INDIRECT = 2; /* Indirect group. */
-    OFPGT_FF       = 3; /* Fast failover group. */
-};
-
-/* Special buffer-id to indicate 'no buffer' */
-//#define OFP_NO_BUFFER 0xffffffff
-
-/* Send packet (controller -> datapath). */
-message ofp_packet_out {
-    //ofp_header header;
-    uint32 buffer_id = 1;          /* ID assigned by datapath (OFP_NO_BUFFER
-                                      if none). */
-    uint32 in_port = 2;            /* Packet's input port or OFPP_CONTROLLER.*/
-    repeated ofp_action actions = 3; /* Action list - 0 or more. */
-    /* The variable size action list is optionally followed by packet data.
-     * This data is only present and meaningful if buffer_id == -1. */
-    bytes data = 4;                /* Packet data. */
-};
-
-/* Why is this packet being sent to the controller? */
-enum ofp_packet_in_reason {
-    OFPR_NO_MATCH    = 0;   /* No matching flow (table-miss flow entry). */
-    OFPR_ACTION      = 1;   /* Action explicitly output to controller. */
-    OFPR_INVALID_TTL = 2;   /* Packet has invalid TTL */
-};
-
-/* Packet received on port (datapath -> controller). */
-message ofp_packet_in {
-    //ofp_header header;
-    uint32 buffer_id = 1;     /* ID assigned by datapath. */
-    ofp_packet_in_reason reason = 2; /* Reason packet is being sent */
-    uint32 table_id = 3;      /* ID of the table that was looked up */
-    uint64 cookie = 4;        /* Cookie of the flow entry that was looked up. */
-    ofp_match match = 5;      /* Packet metadata. Variable size. */
-    bytes data = 6;           /* Ethernet frame */
-};
-
-/* Why was this flow removed? */
-enum ofp_flow_removed_reason {
-    OFPRR_IDLE_TIMEOUT = 0;     /* Flow idle time exceeded idle_timeout. */
-    OFPRR_HARD_TIMEOUT = 1;     /* Time exceeded hard_timeout. */
-    OFPRR_DELETE       = 2;     /* Evicted by a DELETE flow mod. */
-    OFPRR_GROUP_DELETE = 3;     /* Group was removed. */
-    OFPRR_METER_DELETE = 4;     /* Meter was removed */
-};
-
-/* Flow removed (datapath -> controller). */
-message ofp_flow_removed {
-    //ofp_header header;
-    uint64 cookie = 1;         /* Opaque controller-issued identifier. */
-
-    uint32 priority = 2;       /* Priority level of flow entry. */
-    ofp_flow_removed_reason reason = 3; /* One of OFPRR_*. */
-    uint32 table_id = 4;        /* ID of the table */
-
-    uint32 duration_sec = 5;   /* Time flow was alive in seconds. */
-    uint32 duration_nsec = 6;  /* Time flow was alive in nanoseconds beyond
-                                 duration_sec. */
-    uint32 idle_timeout = 7;   /* Idle timeout from original flow mod. */
-    uint32 hard_timeout = 8;   /* Hard timeout from original flow mod. */
-    uint64 packet_count = 9;
-    uint64 byte_count = 10;
-    ofp_match match = 121;  /* Description of fields. Variable size. */
-};
-
-/* Meter numbering. Flow meters can use any number up to OFPM_MAX. */
-enum ofp_meter {
-    OFPM_ZERO       = 0;
-    /* Last usable meter. */
-    OFPM_MAX        = 0x7fff0000;
-
-    /* Virtual meters. */
-    OFPM_SLOWPATH   = 0x7ffffffd;  /* Meter for slow datapath. */
-    OFPM_CONTROLLER = 0x7ffffffe;  /* Meter for controller connection. */
-    OFPM_ALL        = 0x7fffffff;  /* Represents all meters for stat requests
-                                      commands. */
-};
-
-/* Meter band types */
-enum ofp_meter_band_type {
-    OFPMBT_INVALID         = 0;
-    OFPMBT_DROP            = 1;      /* Drop packet. */
-    OFPMBT_DSCP_REMARK     = 2;      /* Remark DSCP in the IP header. */
-    OFPMBT_EXPERIMENTER    = 0xFFFF; /* Experimenter meter band. */
-};
-
-/* Common header for all meter bands */
-message ofp_meter_band_header {
-    ofp_meter_band_type type = 1;   /* One of OFPMBT_*. */
-    uint32              rate = 2;   /* Rate for this band. */
-    uint32              burst_size = 3;/* Size of bursts. */
-    oneof data {
-        ofp_meter_band_drop drop = 4;
-        ofp_meter_band_dscp_remark dscp_remark = 5;
-        ofp_meter_band_experimenter experimenter = 6;
-    }
-};
-
-/* OFPMBT_DROP band - drop packets */
-message ofp_meter_band_drop {
-    //Empty payload
-};
-
-/* OFPMBT_DSCP_REMARK band - Remark DSCP in the IP header */
-message ofp_meter_band_dscp_remark {
-    uint32        prec_level = 1; /* Number of drop precedence level to add. */
-};
-
-/* OFPMBT_EXPERIMENTER band - Experimenter type.
- * The rest of the band is experimenter-defined. */
-message ofp_meter_band_experimenter {
-    uint32              experimenter = 1;/* Experimenter ID which takes the
-                                            same form as in struct
-                                            ofp_experimenter_header. */
-};
-
-/* Meter commands */
-enum ofp_meter_mod_command {
-    OFPMC_ADD = 0;              /* New meter. */
-    OFPMC_MODIFY = 1;           /* Modify specified meter. */
-    OFPMC_DELETE = 2;           /* Delete specified meter. */
-};
-
-/* Meter configuration flags */
-enum ofp_meter_flags {
-    OFPMF_INVALID = 0;
-    OFPMF_KBPS    = 1;     /* Rate value in kb/s (kilo-bit per second). */
-    OFPMF_PKTPS   = 2;     /* Rate value in packet/sec. */
-    OFPMF_BURST   = 4;     /* Do burst size. */
-    OFPMF_STATS   = 8;     /* Collect statistics. */
-};
-
-/* Meter configuration. OFPT_METER_MOD. */
-message ofp_meter_mod {
-    ofp_meter_mod_command command = 1;       /* One of OFPMC_*. */
-    uint32                flags = 2;         /* Bitmap of OFPMF_* flags. */
-    uint32                meter_id = 3;      /* Meter instance. */
-    repeated ofp_meter_band_header bands = 4; /* The band list length is
-                                                 inferred from the length field
-                                                 in the header. */
-};
-
-/* Values for 'type' in ofp_error_message.  These values are immutable: they
- * will not change in future versions of the protocol (although new values may
- * be added). */
-enum ofp_error_type {
-    OFPET_HELLO_FAILED         = 0;  /* Hello protocol failed. */
-    OFPET_BAD_REQUEST          = 1;  /* Request was not understood. */
-    OFPET_BAD_ACTION           = 2;  /* Error in action description. */
-    OFPET_BAD_INSTRUCTION      = 3;  /* Error in instruction list. */
-    OFPET_BAD_MATCH            = 4;  /* Error in match. */
-    OFPET_FLOW_MOD_FAILED      = 5;  /* Problem modifying flow entry. */
-    OFPET_GROUP_MOD_FAILED     = 6;  /* Problem modifying group entry. */
-    OFPET_PORT_MOD_FAILED      = 7;  /* Port mod request failed. */
-    OFPET_TABLE_MOD_FAILED     = 8;  /* Table mod request failed. */
-    OFPET_QUEUE_OP_FAILED      = 9;  /* Queue operation failed. */
-    OFPET_SWITCH_CONFIG_FAILED = 10; /* Switch config request failed. */
-    OFPET_ROLE_REQUEST_FAILED  = 11; /* Controller Role request failed. */
-    OFPET_METER_MOD_FAILED     = 12; /* Error in meter. */
-    OFPET_TABLE_FEATURES_FAILED = 13; /* Setting table features failed. */
-    OFPET_EXPERIMENTER = 0xffff;      /* Experimenter error messages. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_HELLO_FAILED.  'data' contains an
- * ASCII text string that may give failure details. */
-enum ofp_hello_failed_code {
-    OFPHFC_INCOMPATIBLE = 0;    /* No compatible version. */
-    OFPHFC_EPERM        = 1;    /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_BAD_REQUEST.  'data' contains at least
- * the first 64 bytes of the failed request. */
-enum ofp_bad_request_code {
-    OFPBRC_BAD_VERSION      = 0;  /* ofp_header.version not supported. */
-    OFPBRC_BAD_TYPE         = 1;  /* ofp_header.type not supported. */
-    OFPBRC_BAD_MULTIPART    = 2;  /* ofp_multipart_request.type not supported.
-                                   */
-    OFPBRC_BAD_EXPERIMENTER = 3;  /* Experimenter id not supported
-                                   * (in ofp_experimenter_header or
-                                   * ofp_multipart_request or
-                                   * ofp_multipart_reply). */
-    OFPBRC_BAD_EXP_TYPE     = 4;  /* Experimenter type not supported. */
-    OFPBRC_EPERM            = 5;  /* Permissions error. */
-    OFPBRC_BAD_LEN          = 6;  /* Wrong request length for type. */
-    OFPBRC_BUFFER_EMPTY     = 7;  /* Specified buffer has already been used. */
-    OFPBRC_BUFFER_UNKNOWN   = 8;  /* Specified buffer does not exist. */
-    OFPBRC_BAD_TABLE_ID     = 9;  /* Specified table-id invalid or does not
-                                   * exist. */
-    OFPBRC_IS_SLAVE         = 10; /* Denied because controller is slave. */
-    OFPBRC_BAD_PORT         = 11; /* Invalid port. */
-    OFPBRC_BAD_PACKET       = 12; /* Invalid packet in packet-out. */
-    OFPBRC_MULTIPART_BUFFER_OVERFLOW    = 13; /* ofp_multipart_request
-                                     overflowed the assigned buffer. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_BAD_ACTION.  'data' contains at least
- * the first 64 bytes of the failed request. */
-enum ofp_bad_action_code {
-    OFPBAC_BAD_TYPE           = 0;  /* Unknown or unsupported action type. */
-    OFPBAC_BAD_LEN            = 1;  /* Length problem in actions. */
-    OFPBAC_BAD_EXPERIMENTER   = 2;  /* Unknown experimenter id specified. */
-    OFPBAC_BAD_EXP_TYPE       = 3;  /* Unknown action for experimenter id. */
-    OFPBAC_BAD_OUT_PORT       = 4;  /* Problem validating output port. */
-    OFPBAC_BAD_ARGUMENT       = 5;  /* Bad action argument. */
-    OFPBAC_EPERM              = 6;  /* Permissions error. */
-    OFPBAC_TOO_MANY           = 7;  /* Can't handle this many actions. */
-    OFPBAC_BAD_QUEUE          = 8;  /* Problem validating output queue. */
-    OFPBAC_BAD_OUT_GROUP      = 9;  /* Invalid group id in forward action. */
-    OFPBAC_MATCH_INCONSISTENT = 10; /* Action can't apply for this match,
-                                       or Set-Field missing prerequisite. */
-    OFPBAC_UNSUPPORTED_ORDER  = 11; /* Action order is unsupported for the
-                                 action list in an Apply-Actions instruction */
-    OFPBAC_BAD_TAG            = 12; /* Actions uses an unsupported
-                                       tag/encap. */
-    OFPBAC_BAD_SET_TYPE       = 13; /* Unsupported type in SET_FIELD action. */
-    OFPBAC_BAD_SET_LEN        = 14; /* Length problem in SET_FIELD action. */
-    OFPBAC_BAD_SET_ARGUMENT   = 15; /* Bad argument in SET_FIELD action. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_BAD_INSTRUCTION.  'data' contains at
- * least the first 64 bytes of the failed request. */
-enum ofp_bad_instruction_code {
-    OFPBIC_UNKNOWN_INST     = 0; /* Unknown instruction. */
-    OFPBIC_UNSUP_INST       = 1; /* Switch or table does not support the
-                                    instruction. */
-    OFPBIC_BAD_TABLE_ID     = 2; /* Invalid Table-ID specified. */
-    OFPBIC_UNSUP_METADATA   = 3; /* Metadata value unsupported by datapath. */
-    OFPBIC_UNSUP_METADATA_MASK = 4; /* Metadata mask value unsupported by
-                                       datapath. */
-    OFPBIC_BAD_EXPERIMENTER = 5; /* Unknown experimenter id specified. */
-    OFPBIC_BAD_EXP_TYPE     = 6; /* Unknown instruction for experimenter id. */
-    OFPBIC_BAD_LEN          = 7; /* Length problem in instructions. */
-    OFPBIC_EPERM            = 8; /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_BAD_MATCH.  'data' contains at least
- * the first 64 bytes of the failed request. */
-enum ofp_bad_match_code {
-    OFPBMC_BAD_TYPE         = 0;  /* Unsupported match type specified by the
-                                     match */
-    OFPBMC_BAD_LEN          = 1;  /* Length problem in match. */
-    OFPBMC_BAD_TAG          = 2;  /* Match uses an unsupported tag/encap. */
-    OFPBMC_BAD_DL_ADDR_MASK = 3;  /* Unsupported datalink addr mask - switch
-                                     does not support arbitrary datalink
-                                     address mask. */
-    OFPBMC_BAD_NW_ADDR_MASK = 4;  /* Unsupported network addr mask - switch
-                                     does not support arbitrary network
-                                     address mask. */
-    OFPBMC_BAD_WILDCARDS    = 5;  /* Unsupported combination of fields masked
-                                     or omitted in the match. */
-    OFPBMC_BAD_FIELD        = 6;  /* Unsupported field type in the match. */
-    OFPBMC_BAD_VALUE        = 7;  /* Unsupported value in a match field. */
-    OFPBMC_BAD_MASK         = 8;  /* Unsupported mask specified in the match,
-                                     field is not dl-address or nw-address. */
-    OFPBMC_BAD_PREREQ       = 9;  /* A prerequisite was not met. */
-    OFPBMC_DUP_FIELD        = 10; /* A field type was duplicated. */
-    OFPBMC_EPERM            = 11; /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_FLOW_MOD_FAILED.  'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_flow_mod_failed_code {
-    OFPFMFC_UNKNOWN      = 0;   /* Unspecified error. */
-    OFPFMFC_TABLE_FULL   = 1;   /* Flow not added because table was full. */
-    OFPFMFC_BAD_TABLE_ID = 2;   /* Table does not exist */
-    OFPFMFC_OVERLAP      = 3;   /* Attempted to add overlapping flow with
-                                   CHECK_OVERLAP flag set. */
-    OFPFMFC_EPERM        = 4;   /* Permissions error. */
-    OFPFMFC_BAD_TIMEOUT  = 5;   /* Flow not added because of unsupported
-                                   idle/hard timeout. */
-    OFPFMFC_BAD_COMMAND  = 6;   /* Unsupported or unknown command. */
-    OFPFMFC_BAD_FLAGS    = 7;   /* Unsupported or unknown flags. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_GROUP_MOD_FAILED.  'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_group_mod_failed_code {
-    OFPGMFC_GROUP_EXISTS         = 0;  /* Group not added because a group ADD
-                                          attempted to replace an
-                                          already-present group. */
-    OFPGMFC_INVALID_GROUP        = 1;  /* Group not added because Group
-                                          specified is invalid. */
-    OFPGMFC_WEIGHT_UNSUPPORTED   = 2;  /* Switch does not support unequal load
-                                          sharing with select groups. */
-    OFPGMFC_OUT_OF_GROUPS        = 3;  /* The group table is full. */
-    OFPGMFC_OUT_OF_BUCKETS       = 4;  /* The maximum number of action buckets
-                                          for a group has been exceeded. */
-    OFPGMFC_CHAINING_UNSUPPORTED = 5;  /* Switch does not support groups that
-                                          forward to groups. */
-    OFPGMFC_WATCH_UNSUPPORTED    = 6;  /* This group cannot watch the
-                                          watch_port or watch_group specified.
-                                        */
-    OFPGMFC_LOOP                 = 7;  /* Group entry would cause a loop. */
-    OFPGMFC_UNKNOWN_GROUP        = 8;  /* Group not modified because a group
-                                          MODIFY attempted to modify a
-                                          non-existent group. */
-    OFPGMFC_CHAINED_GROUP        = 9;  /* Group not deleted because another
-                                          group is forwarding to it. */
-    OFPGMFC_BAD_TYPE             = 10; /* Unsupported or unknown group type. */
-    OFPGMFC_BAD_COMMAND          = 11; /* Unsupported or unknown command. */
-    OFPGMFC_BAD_BUCKET           = 12; /* Error in bucket. */
-    OFPGMFC_BAD_WATCH            = 13; /* Error in watch port/group. */
-    OFPGMFC_EPERM                = 14; /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_PORT_MOD_FAILED.  'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_port_mod_failed_code {
-    OFPPMFC_BAD_PORT      = 0;   /* Specified port number does not exist. */
-    OFPPMFC_BAD_HW_ADDR   = 1;   /* Specified hardware address does not
-                                  * match the port number. */
-    OFPPMFC_BAD_CONFIG    = 2;   /* Specified config is invalid. */
-    OFPPMFC_BAD_ADVERTISE = 3;   /* Specified advertise is invalid. */
-    OFPPMFC_EPERM         = 4;   /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_TABLE_MOD_FAILED.  'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_table_mod_failed_code {
-    OFPTMFC_BAD_TABLE  = 0;      /* Specified table does not exist. */
-    OFPTMFC_BAD_CONFIG = 1;      /* Specified config is invalid. */
-    OFPTMFC_EPERM      = 2;      /* Permissions error. */
-};
-
-/* ofp_error msg 'code' values for OFPET_QUEUE_OP_FAILED. 'data' contains
- * at least the first 64 bytes of the failed request */
-enum ofp_queue_op_failed_code {
-    OFPQOFC_BAD_PORT   = 0;     /* Invalid port (or port does not exist). */
-    OFPQOFC_BAD_QUEUE  = 1;     /* Queue does not exist. */
-    OFPQOFC_EPERM      = 2;     /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_SWITCH_CONFIG_FAILED. 'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_switch_config_failed_code {
-    OFPSCFC_BAD_FLAGS  = 0;      /* Specified flags is invalid. */
-    OFPSCFC_BAD_LEN    = 1;      /* Specified len is invalid. */
-    OFPSCFC_EPERM      = 2;      /* Permissions error. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_ROLE_REQUEST_FAILED. 'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_role_request_failed_code {
-    OFPRRFC_STALE      = 0;      /* Stale Message: old generation_id. */
-    OFPRRFC_UNSUP      = 1;      /* Controller role change unsupported. */
-    OFPRRFC_BAD_ROLE   = 2;      /* Invalid role. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_METER_MOD_FAILED.  'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_meter_mod_failed_code {
-    OFPMMFC_UNKNOWN       = 0;  /* Unspecified error. */
-    OFPMMFC_METER_EXISTS  = 1;  /* Meter not added because a Meter ADD
-                                 * attempted to replace an existing Meter. */
-    OFPMMFC_INVALID_METER = 2;  /* Meter not added because Meter specified
-                                 * is invalid,
-                                 * or invalid meter in meter action. */
-    OFPMMFC_UNKNOWN_METER = 3;  /* Meter not modified because a Meter MODIFY
-                                 * attempted to modify a non-existent Meter,
-                                 * or bad meter in meter action. */
-    OFPMMFC_BAD_COMMAND   = 4;  /* Unsupported or unknown command. */
-    OFPMMFC_BAD_FLAGS     = 5;  /* Flag configuration unsupported. */
-    OFPMMFC_BAD_RATE      = 6;  /* Rate unsupported. */
-    OFPMMFC_BAD_BURST     = 7;  /* Burst size unsupported. */
-    OFPMMFC_BAD_BAND      = 8;  /* Band unsupported. */
-    OFPMMFC_BAD_BAND_VALUE = 9; /* Band value unsupported. */
-    OFPMMFC_OUT_OF_METERS = 10; /* No more meters available. */
-    OFPMMFC_OUT_OF_BANDS  = 11; /* The maximum number of properties
-                                 * for a meter has been exceeded. */
-};
-
-/* ofp_error_msg 'code' values for OFPET_TABLE_FEATURES_FAILED. 'data' contains
- * at least the first 64 bytes of the failed request. */
-enum ofp_table_features_failed_code {
-    OFPTFFC_BAD_TABLE    = 0;      /* Specified table does not exist. */
-    OFPTFFC_BAD_METADATA = 1;      /* Invalid metadata mask. */
-    OFPTFFC_BAD_TYPE     = 2;      /* Unknown property type. */
-    OFPTFFC_BAD_LEN      = 3;      /* Length problem in properties. */
-    OFPTFFC_BAD_ARGUMENT = 4;      /* Unsupported property value. */
-    OFPTFFC_EPERM        = 5;      /* Permissions error. */
-};
-
-/* OFPT_ERROR: Error message (datapath -> controller). */
-message ofp_error_msg {
-    //ofp_header header;
-    uint32 type = 1;
-    uint32 code = 2;
-    bytes data = 3;          /* Variable-length data.  Interpreted based
-                                 on the type and code.  No padding. */
-};
-
-/* OFPET_EXPERIMENTER: Error message (datapath -> controller). */
-message ofp_error_experimenter_msg {
-    //ofp_header header;
-
-    uint32 type = 1;           /* OFPET_EXPERIMENTER. */
-    uint32 exp_type = 2;       /* Experimenter defined. */
-    uint32 experimenter = 3;   /* Experimenter ID which takes the same form
-                                    as in struct ofp_experimenter_header. */
-    bytes data = 4;              /* Variable-length data.  Interpreted based
-                                    on the type and code.  No padding. */
-};
-
-enum ofp_multipart_type {
-    /* Description of this OpenFlow switch.
-     * The request body is empty.
-     * The reply body is struct ofp_desc. */
-    OFPMP_DESC = 0;
-
-    /* Individual flow statistics.
-     * The request body is struct ofp_flow_stats_request.
-     * The reply body is an array of struct ofp_flow_stats. */
-    OFPMP_FLOW = 1;
-
-    /* Aggregate flow statistics.
-     * The request body is struct ofp_aggregate_stats_request.
-     * The reply body is struct ofp_aggregate_stats_reply. */
-    OFPMP_AGGREGATE = 2;
-
-    /* Flow table statistics.
-     * The request body is empty.
-     * The reply body is an array of struct ofp_table_stats. */
-    OFPMP_TABLE = 3;
-
-    /* Port statistics.
-     * The request body is struct ofp_port_stats_request.
-     * The reply body is an array of struct ofp_port_stats. */
-    OFPMP_PORT_STATS = 4;
-
-    /* Queue statistics for a port
-     * The request body is struct ofp_queue_stats_request.
-     * The reply body is an array of struct ofp_queue_stats */
-    OFPMP_QUEUE = 5;
-
-    /* Group counter statistics.
-     * The request body is struct ofp_group_stats_request.
-     * The reply is an array of struct ofp_group_stats. */
-    OFPMP_GROUP = 6;
-
-    /* Group description.
-     * The request body is empty.
-     * The reply body is an array of struct ofp_group_desc. */
-    OFPMP_GROUP_DESC = 7;
-
-    /* Group features.
-     * The request body is empty.
-     * The reply body is struct ofp_group_features. */
-    OFPMP_GROUP_FEATURES = 8;
-
-    /* Meter statistics.
-     * The request body is struct ofp_meter_multipart_requests.
-     * The reply body is an array of struct ofp_meter_stats. */
-    OFPMP_METER = 9;
-
-    /* Meter configuration.
-     * The request body is struct ofp_meter_multipart_requests.
-     * The reply body is an array of struct ofp_meter_config. */
-    OFPMP_METER_CONFIG = 10;
-
-    /* Meter features.
-     * The request body is empty.
-     * The reply body is struct ofp_meter_features. */
-    OFPMP_METER_FEATURES = 11;
-
-    /* Table features.
-     * The request body is either empty or contains an array of
-     * struct ofp_table_features containing the controller's
-     * desired view of the switch. If the switch is unable to
-     * set the specified view an error is returned.
-     * The reply body is an array of struct ofp_table_features. */
-    OFPMP_TABLE_FEATURES = 12;
-
-    /* Port description.
-     * The request body is empty.
-     * The reply body is an array of struct ofp_port. */
-    OFPMP_PORT_DESC = 13;
-
-    /* Experimenter extension.
-     * The request and reply bodies begin with
-     * struct ofp_experimenter_multipart_header.
-     * The request and reply bodies are otherwise experimenter-defined. */
-    OFPMP_EXPERIMENTER = 0xffff;
-};
-
-/* Backward compatibility with 1.3.1 - avoid breaking the API. */
-//#define ofp_multipart_types ofp_multipart_type
-
-enum ofp_multipart_request_flags {
-    OFPMPF_REQ_INVALID = 0;
-    OFPMPF_REQ_MORE  = 1;  /* More requests to follow. */
-};
-
-message ofp_multipart_request {
-    //ofp_header header;
-    ofp_multipart_type type = 1; /* One of the OFPMP_* constants. */
-    uint32 flags = 2;            /* OFPMPF_REQ_* flags. */
-    bytes body = 3;              /* Body of the request. 0 or more bytes. */
-};
-
-enum ofp_multipart_reply_flags {
-    OFPMPF_REPLY_INVALID = 0;
-    OFPMPF_REPLY_MORE  = 1;  /* More replies to follow. */
-};
-
-message ofp_multipart_reply {
-    //ofp_header header;
-    ofp_multipart_type type = 1; /* One of the OFPMP_* constants. */
-    uint32 flags = 2;            /* OFPMPF_REPLY_* flags. */
-    bytes body = 3;              /* Body of the reply. 0 or more bytes. */
-};
-
-//#define DESC_STR_LEN   256
-//#define SERIAL_NUM_LEN 32
-/* Body of reply to OFPMP_DESC request.  Each entry is a NULL-terminated
- * ASCII string. */
-message ofp_desc {
-    string mfr_desc = 1;       /* Manufacturer description. */
-    string hw_desc = 2;        /* Hardware description. */
-    string sw_desc = 3;        /* Software description. */
-    string serial_num = 4;     /* Serial number. */
-    string dp_desc = 5;        /* Human readable description of datapath. */
-};
-
-/* Body for ofp_multipart_request of type OFPMP_FLOW. */
-message ofp_flow_stats_request {
-    uint32 table_id = 1;       /* ID of table to read (from ofp_table_stats),
-                                    OFPTT_ALL for all tables. */
-    uint32 out_port = 2;       /* Require matching entries to include this
-                                    as an output port.  A value of OFPP_ANY
-                                    indicates no restriction. */
-    uint32 out_group = 3;      /* Require matching entries to include this
-                                    as an output group.  A value of OFPG_ANY
-                                    indicates no restriction. */
-    uint64 cookie = 4;         /* Require matching entries to contain this
-                                    cookie value */
-    uint64 cookie_mask = 5;    /* Mask used to restrict the cookie bits that
-                                    must match. A value of 0 indicates
-                                    no restriction. */
-    ofp_match match = 6;         /* Fields to match. Variable size. */
-};
-
-/* Body of reply to OFPMP_FLOW request. */
-message ofp_flow_stats {
-    uint64 id = 14;            /* Unique ID of flow within device. */
-    uint32 table_id = 1;       /* ID of table flow came from. */
-    uint32 duration_sec = 2;   /* Time flow has been alive in seconds. */
-    uint32 duration_nsec = 3;  /* Time flow has been alive in nanoseconds
-                                  beyond duration_sec. */
-    uint32 priority = 4;       /* Priority of the entry. */
-    uint32 idle_timeout = 5;   /* Number of seconds idle before expiration. */
-    uint32 hard_timeout = 6;   /* Number of seconds before expiration. */
-    uint32 flags = 7;          /* Bitmap of OFPFF_* flags. */
-    uint64 cookie = 8;         /* Opaque controller-issued identifier. */
-    uint64 packet_count = 9;   /* Number of packets in flow. */
-    uint64 byte_count = 10;    /* Number of bytes in flow. */
-    ofp_match match = 12;      /* Description of fields. Variable size. */
-    repeated ofp_instruction instructions = 13; /* Instruction set
-                                                   (0 or more) */
-};
-
-/* Body for ofp_multipart_request of type OFPMP_AGGREGATE. */
-message ofp_aggregate_stats_request {
-    uint32 table_id = 1;      /* ID of table to read (from ofp_table_stats)
-                                 OFPTT_ALL for all tables. */
-    uint32 out_port = 2;      /* Require matching entries to include this
-                                 as an output port.  A value of OFPP_ANY
-                                 indicates no restriction. */
-    uint32 out_group = 3;     /* Require matching entries to include this
-                                 as an output group.  A value of OFPG_ANY
-                                 indicates no restriction. */
-    uint64 cookie = 4;        /* Require matching entries to contain this
-                                 cookie value */
-    uint64 cookie_mask = 5;   /* Mask used to restrict the cookie bits that
-                                 must match. A value of 0 indicates
-                                 no restriction. */
-    ofp_match match = 6;      /* Fields to match. Variable size. */
-};
-
-/* Body of reply to OFPMP_AGGREGATE request. */
-message ofp_aggregate_stats_reply {
-    uint64 packet_count = 1;   /* Number of packets in flows. */
-    uint64 byte_count = 2;     /* Number of bytes in flows. */
-    uint32 flow_count = 3;     /* Number of flows. */
-};
-
-/* Table Feature property types.
- * Low order bit cleared indicates a property for a regular Flow Entry.
- * Low order bit set indicates a property for the Table-Miss Flow Entry.
- */
-enum ofp_table_feature_prop_type {
-    OFPTFPT_INSTRUCTIONS           = 0;  /* Instructions property. */
-    OFPTFPT_INSTRUCTIONS_MISS      = 1;  /* Instructions for table-miss. */
-    OFPTFPT_NEXT_TABLES            = 2;  /* Next Table property. */
-    OFPTFPT_NEXT_TABLES_MISS       = 3;  /* Next Table for table-miss. */
-    OFPTFPT_WRITE_ACTIONS          = 4;  /* Write Actions property. */
-    OFPTFPT_WRITE_ACTIONS_MISS     = 5;  /* Write Actions for table-miss. */
-    OFPTFPT_APPLY_ACTIONS          = 6;  /* Apply Actions property. */
-    OFPTFPT_APPLY_ACTIONS_MISS     = 7;  /* Apply Actions for table-miss. */
-    OFPTFPT_MATCH                  = 8;  /* Match property. */
-    OFPTFPT_WILDCARDS              = 10; /* Wildcards property. */
-    OFPTFPT_WRITE_SETFIELD         = 12; /* Write Set-Field property. */
-    OFPTFPT_WRITE_SETFIELD_MISS    = 13; /* Write Set-Field for table-miss. */
-    OFPTFPT_APPLY_SETFIELD         = 14; /* Apply Set-Field property. */
-    OFPTFPT_APPLY_SETFIELD_MISS    = 15; /* Apply Set-Field for table-miss. */
-    OFPTFPT_EXPERIMENTER           = 0xFFFE; /* Experimenter property. */
-    OFPTFPT_EXPERIMENTER_MISS      = 0xFFFF; /* Experimenter for table-miss. */
-};
-
-/* Common header for all Table Feature Properties */
-message ofp_table_feature_property {
-    ofp_table_feature_prop_type type = 1;   /* One of OFPTFPT_*. */
-    oneof value {
-        ofp_table_feature_prop_instructions instructions = 2;
-        ofp_table_feature_prop_next_tables next_tables = 3;
-        ofp_table_feature_prop_actions actions = 4;
-        ofp_table_feature_prop_oxm oxm = 5;
-        ofp_table_feature_prop_experimenter experimenter = 6;
-    }
-};
-
-/* Instructions property */
-message ofp_table_feature_prop_instructions {
-    /* One of OFPTFPT_INSTRUCTIONS,
-       OFPTFPT_INSTRUCTIONS_MISS. */
-    repeated ofp_instruction instructions = 1;   /* List of instructions */
-};
-
-/* Next Tables property */
-message ofp_table_feature_prop_next_tables {
-    /* One of OFPTFPT_NEXT_TABLES,
-       OFPTFPT_NEXT_TABLES_MISS. */
-    repeated uint32 next_table_ids = 1;     /* List of table ids. */
-};
-
-/* Actions property */
-message ofp_table_feature_prop_actions {
-    /* One of OFPTFPT_WRITE_ACTIONS,
-       OFPTFPT_WRITE_ACTIONS_MISS,
-       OFPTFPT_APPLY_ACTIONS,
-       OFPTFPT_APPLY_ACTIONS_MISS. */
-    repeated ofp_action actions = 1; /* List of actions */
-};
-
-/* Match, Wildcard or Set-Field property */
-message ofp_table_feature_prop_oxm {
-    /* One of OFPTFPT_MATCH,
-       OFPTFPT_WILDCARDS,
-       OFPTFPT_WRITE_SETFIELD,
-       OFPTFPT_WRITE_SETFIELD_MISS,
-       OFPTFPT_APPLY_SETFIELD,
-       OFPTFPT_APPLY_SETFIELD_MISS. */
-    /* TODO is this a uint32??? */
-    repeated uint32 oxm_ids = 3;    /* Array of OXM headers */
-};
-
-/* Experimenter table feature property */
-message ofp_table_feature_prop_experimenter {
-    /* One of OFPTFPT_EXPERIMENTER,
-       OFPTFPT_EXPERIMENTER_MISS. */
-    uint32         experimenter = 2; /* Experimenter ID which takes the same
-                                        form as in struct
-                                        ofp_experimenter_header. */
-    uint32         exp_type = 3;      /* Experimenter defined. */
-    repeated uint32 experimenter_data = 4;
-};
-
-/* Body for ofp_multipart_request of type OFPMP_TABLE_FEATURES./
- * Body of reply to OFPMP_TABLE_FEATURES request. */
-message ofp_table_features {
-    uint32 table_id = 1;       /* Identifier of table.  Lower numbered tables
-                                are consulted first. */
-    string name = 2;
-    uint64 metadata_match = 3; /* Bits of metadata table can match. */
-    uint64 metadata_write = 4; /* Bits of metadata table can write. */
-    uint32 config = 5;         /* Bitmap of OFPTC_* values */
-    uint32 max_entries = 6;    /* Max number of entries supported. */
-
-    /* Table Feature Property list */
-    repeated ofp_table_feature_property properties = 7;
-};
-
-/* Body of reply to OFPMP_TABLE request. */
-message ofp_table_stats {
-    uint32 table_id = 1;      /* Identifier of table.  Lower numbered tables
-                                 are consulted first. */
-    uint32 active_count = 2;  /* Number of active entries. */
-    uint64 lookup_count = 3;  /* Number of packets looked up in table. */
-    uint64 matched_count = 4; /* Number of packets that hit table. */
-};
-
-/* Body for ofp_multipart_request of type OFPMP_PORT. */
-message ofp_port_stats_request {
-    uint32 port_no = 1;       /* OFPMP_PORT message must request statistics
-                               * either for a single port (specified in
-                               * port_no) or for all ports (if port_no ==
-                               * OFPP_ANY). */
-};
-
-/* Body of reply to OFPMP_PORT request. If a counter is unsupported, set
- * the field to all ones. */
-message ofp_port_stats {
-    uint32 port_no = 1;
-    uint64 rx_packets = 2;   /* Number of received packets. */
-    uint64 tx_packets = 3;   /* Number of transmitted packets. */
-    uint64 rx_bytes = 4;     /* Number of received bytes. */
-    uint64 tx_bytes = 5;     /* Number of transmitted bytes. */
-    uint64 rx_dropped = 6;   /* Number of packets dropped by RX. */
-    uint64 tx_dropped = 7;   /* Number of packets dropped by TX. */
-    uint64 rx_errors = 8;    /* Number of receive errors.  This is a super-set
-                                of more specific receive errors and should be
-                                greater than or equal to the sum of all
-                                rx_*_err values. */
-    uint64 tx_errors = 9;    /* Number of transmit errors.  This is a super-set
-                                of more specific transmit errors and should be
-                                greater than or equal to the sum of all
-                                tx_*_err values (none currently defined.) */
-    uint64 rx_frame_err = 10;  /* Number of frame alignment errors. */
-    uint64 rx_over_err = 11;   /* Number of packets with RX overrun. */
-    uint64 rx_crc_err = 12;    /* Number of CRC errors. */
-    uint64 collisions = 13;    /* Number of collisions. */
-    uint32 duration_sec = 14;  /* Time port has been alive in seconds. */
-    uint32 duration_nsec = 15; /* Time port has been alive in nanoseconds
-                                  beyond duration_sec. */
-};
-
-/* Body of OFPMP_GROUP request. */
-message ofp_group_stats_request {
-    uint32 group_id = 1;      /* All groups if OFPG_ALL. */
-};
-
-/* Used in group stats replies. */
-message ofp_bucket_counter {
-    uint64 packet_count = 1;  /* Number of packets processed by bucket. */
-    uint64 byte_count = 2;    /* Number of bytes processed by bucket. */
-};
-
-/* Body of reply to OFPMP_GROUP request. */
-message ofp_group_stats {
-    uint32 group_id = 1;      /* Group identifier. */
-    uint32 ref_count = 2;     /* Number of flows or groups that directly
-                                 forward to this group. */
-    uint64 packet_count = 3;  /* Number of packets processed by group. */
-    uint64 byte_count = 4;    /* Number of bytes processed by group. */
-    uint32 duration_sec = 5;  /* Time group has been alive in seconds. */
-    uint32 duration_nsec = 6; /* Time group has been alive in nanoseconds
-                                 beyond duration_sec. */
-    repeated ofp_bucket_counter bucket_stats = 7; /* One counter set per
-                                                     bucket. */
-};
-
-/* Body of reply to OFPMP_GROUP_DESC request. */
-message ofp_group_desc {
-    ofp_group_type type = 1;       /* One of OFPGT_*. */
-    uint32 group_id = 2;           /* Group identifier. */
-    repeated ofp_bucket buckets = 3;   /* List of buckets - 0 or more. */
-};
-
-message ofp_group_entry {
-    ofp_group_desc desc = 1 [(common.yang_inline_node).id = 'desc',
-                            (common.yang_inline_node).type = 'openflow_13-ofp_group_desc'];
-    ofp_group_stats stats = 2;
-};
-
-/* Backward compatibility with 1.3.1 - avoid breaking the API. */
-//#define ofp_group_desc_stats ofp_group_desc
-
-/* Group configuration flags */
-enum ofp_group_capabilities {
-    OFPGFC_INVALID         = 0;
-    OFPGFC_SELECT_WEIGHT   = 1;  /* Support weight for select groups */
-    OFPGFC_SELECT_LIVENESS = 2;  /* Support liveness for select groups */
-    OFPGFC_CHAINING        = 4;  /* Support chaining groups */
-    OFPGFC_CHAINING_CHECKS = 8;  /* Check chaining for loops and delete */
-};
-
-/* Body of reply to OFPMP_GROUP_FEATURES request. Group features. */
-message ofp_group_features {
-    uint32  types = 1;         /* Bitmap of (1 << OFPGT_*) values supported. */
-    uint32  capabilities = 2;  /* Bitmap of OFPGFC_* capability supported. */
-    repeated uint32 max_groups = 3; /* Maximum number of groups for each type.
-                                     */
-    repeated uint32 actions = 4;    /* Bitmaps of (1 << OFPAT_*) values
-                                       supported. */
-};
-
-/* Body of OFPMP_METER and OFPMP_METER_CONFIG requests. */
-message ofp_meter_multipart_request {
-    uint32 meter_id = 1;      /* Meter instance, or OFPM_ALL. */
-};
-
-/* Statistics for each meter band */
-message ofp_meter_band_stats {
-    uint64        packet_band_count = 1;  /* Number of packets in band. */
-    uint64        byte_band_count = 2;    /* Number of bytes in band. */
-};
-
-/* Body of reply to OFPMP_METER request. Meter statistics. */
-message ofp_meter_stats {
-    uint32        meter_id = 1;        /* Meter instance. */
-    uint32        flow_count = 2;      /* Number of flows bound to meter. */
-    uint64        packet_in_count = 3; /* Number of packets in input. */
-    uint64        byte_in_count = 4;   /* Number of bytes in input. */
-    uint32        duration_sec = 5; /* Time meter has been alive in seconds. */
-    uint32        duration_nsec = 6;/* Time meter has been alive in nanoseconds
-                                       beyond duration_sec. */
-    repeated ofp_meter_band_stats band_stats = 7; /* The band_stats length is
-                                         inferred from the length field. */
-};
-
-/* Body of reply to OFPMP_METER_CONFIG request. Meter configuration. */
-message ofp_meter_config {
-    uint32        flags = 1;           /* All OFPMF_* that apply. */
-    uint32        meter_id = 2;        /* Meter instance. */
-    repeated ofp_meter_band_header bands = 3; /* The bands length is
-                                             inferred from the length field. */
-};
-
-/* Body of reply to OFPMP_METER_FEATURES request. Meter features. */
-message ofp_meter_features {
-    uint32    max_meter = 1;    /* Maximum number of meters. */
-    uint32    band_types = 2;   /* Bitmaps of (1 << OFPMBT_*) values supported.
-                                 */
-    uint32    capabilities = 3; /* Bitmaps of "ofp_meter_flags". */
-    uint32    max_bands = 4;    /* Maximum bands per meters */
-    uint32    max_color = 5;    /* Maximum color value */
-};
-
-message ofp_meter_entry {
-    ofp_meter_config config=1 [(common.yang_inline_node).id = 'config',
-                              (common.yang_inline_node).type = 'openflow_13-ofp_meter_config'];
-    ofp_meter_stats stats=2;
-}
-
-/* Body for ofp_multipart_request/reply of type OFPMP_EXPERIMENTER. */
-message ofp_experimenter_multipart_header {
-    uint32 experimenter = 1;   /* Experimenter ID which takes the same form
-                                  as in struct ofp_experimenter_header. */
-    uint32 exp_type = 2;       /* Experimenter defined. */
-    bytes data = 3; /* Experimenter-defined arbitrary additional data. */
-};
-
-/* Experimenter extension. */
-message ofp_experimenter_header {
-    //ofp_header header;  /* Type OFPT_EXPERIMENTER. */
-    uint32 experimenter = 1;     /* Experimenter ID:
-                                 * - MSB 0: low-order bytes are IEEE OUI.
-                                 * - MSB != 0: defined by ONF. */
-    uint32 exp_type = 2;         /* Experimenter defined. */
-    bytes data = 3; /* Experimenter-defined arbitrary additional data. */
-};
-
-/* All ones is used to indicate all queues in a port (for stats retrieval). */
-//#define OFPQ_ALL      0xffffffff
-
-/* Min rate > 1000 means not configured. */
-//#define OFPQ_MIN_RATE_UNCFG      0xffff
-
-/* Max rate > 1000 means not configured. */
-//#define OFPQ_MAX_RATE_UNCFG      0xffff
-
-enum ofp_queue_properties {
-    OFPQT_INVALID       = 0;
-    OFPQT_MIN_RATE      = 1;      /* Minimum datarate guaranteed. */
-    OFPQT_MAX_RATE      = 2;      /* Maximum datarate. */
-    OFPQT_EXPERIMENTER  = 0xffff; /* Experimenter defined property. */
-};
-
-/* Common description for a queue. */
-message ofp_queue_prop_header {
-    uint32 property = 1;   /* One of OFPQT_. */
-    uint32 len = 2;        /* Length of property, including this header. */
-};
-
-/* Min-Rate queue property description. */
-message ofp_queue_prop_min_rate {
-    ofp_queue_prop_header prop_header = 1;/* prop: OFPQT_MIN, len: 16. */
-    uint32 rate = 2;       /* In 1/10 of a percent = 0;>1000 -> disabled. */
-};
-
-/* Max-Rate queue property description. */
-message ofp_queue_prop_max_rate {
-    ofp_queue_prop_header prop_header = 1;/* prop: OFPQT_MAX, len: 16. */
-    uint32 rate = 2;       /* In 1/10 of a percent = 0;>1000 -> disabled. */
-};
-
-/* Experimenter queue property description. */
-message ofp_queue_prop_experimenter {
-    ofp_queue_prop_header prop_header = 1;/* prop: OFPQT_EXPERIMENTER */
-    uint32 experimenter = 2;         /* Experimenter ID which takes the same
-                                          form as in struct
-                                          ofp_experimenter_header. */
-    bytes data = 3;                    /* Experimenter defined data. */
-};
-
-/* Full description for a queue. */
-message ofp_packet_queue {
-    uint32 queue_id = 1;    /* id for the specific queue. */
-    uint32 port = 2;        /* Port this queue is attached to. */
-    repeated ofp_queue_prop_header properties = 4; /* List of properties. */
-};
-
-/* Query for port queue configuration. */
-message ofp_queue_get_config_request {
-    //ofp_header header;
-    uint32 port = 1;        /* Port to be queried. Should refer
-                              to a valid physical port (i.e. <= OFPP_MAX),
-                              or OFPP_ANY to request all configured
-                              queues.*/
-};
-
-/* Queue configuration for a given port. */
-message ofp_queue_get_config_reply {
-    //ofp_header header;
-    uint32 port = 1;
-    repeated ofp_packet_queue queues = 2; /* List of configured queues. */
-};
-
-/* OFPAT_SET_QUEUE action struct: send packets to given queue on port. */
-message ofp_action_set_queue {
-    uint32 type = 1;           /* OFPAT_SET_QUEUE. */
-    uint32 queue_id = 3;       /* Queue id for the packets. */
-};
-
-message ofp_queue_stats_request {
-    uint32 port_no = 1;       /* All ports if OFPP_ANY. */
-    uint32 queue_id = 2;      /* All queues if OFPQ_ALL. */
-};
-
-message ofp_queue_stats {
-    uint32 port_no = 1;
-    uint32 queue_id = 2;      /* Queue i.d */
-    uint64 tx_bytes = 3;      /* Number of transmitted bytes. */
-    uint64 tx_packets = 4;    /* Number of transmitted packets. */
-    uint64 tx_errors = 5;     /* Number of packets dropped due to overrun. */
-    uint32 duration_sec = 6;  /* Time queue has been alive in seconds. */
-    uint32 duration_nsec = 7; /* Time queue has been alive in nanoseconds
-                                 beyond duration_sec. */
-};
-
-/* Configures the "role" of the sending controller.  The default role is:
- *
- *    - Equal (OFPCR_ROLE_EQUAL), which allows the controller access to all
- *      OpenFlow features. All controllers have equal responsibility.
- *
- * The other possible roles are a related pair:
- *
- *    - Master (OFPCR_ROLE_MASTER) is equivalent to Equal, except that there
- *      may be at most one Master controller at a time: when a controller
- *      configures itself as Master, any existing Master is demoted to the
- *      Slave role.
- *
- *    - Slave (OFPCR_ROLE_SLAVE) allows the controller read-only access to
- *      OpenFlow features.  In particular attempts to modify the flow table
- *      will be rejected with an OFPBRC_EPERM error.
- *
- *      Slave controllers do not receive OFPT_PACKET_IN or OFPT_FLOW_REMOVED
- *      messages, but they do receive OFPT_PORT_STATUS messages.
- */
-
-/* Controller roles. */
-enum ofp_controller_role {
-    OFPCR_ROLE_NOCHANGE = 0;    /* Don't change current role. */
-    OFPCR_ROLE_EQUAL    = 1;    /* Default role, full access. */
-    OFPCR_ROLE_MASTER   = 2;    /* Full access, at most one master. */
-    OFPCR_ROLE_SLAVE    = 3;    /* Read-only access. */
-};
-
-/* Role request and reply message. */
-message ofp_role_request {
-    //ofp_header header;        /* Type OFPT_ROLE_REQUEST/OFPT_ROLE_REPLY. */
-    ofp_controller_role role = 1; /* One of OFPCR_ROLE_*. */
-    uint64 generation_id = 2;     /* Master Election Generation Id */
-};
-
-/* Asynchronous message configuration. */
-message ofp_async_config {
-    //ofp_header header;    /* OFPT_GET_ASYNC_REPLY or OFPT_SET_ASYNC. */
-    repeated uint32 packet_in_mask = 1;   /* Bitmasks of OFPR_* values. */
-    repeated uint32 port_status_mask = 2; /* Bitmasks of OFPPR_* values. */
-    repeated uint32 flow_removed_mask = 3;/* Bitmasks of OFPRR_* values. */
-};
-
-
-/* ADDITIONAL VOLTHA SPECIFIC MESSAGE TYPES, AIDING RPC CALLS */
-
-message MeterModUpdate {
-    string id = 1;      // Device.id or LogicalDevice.id
-    ofp_meter_mod meter_mod = 2;
-}
-
-message MeterStatsReply {
-    repeated ofp_meter_stats meter_stats = 1;
-}
-
-message FlowTableUpdate {
-    string id = 1;  // Device.id or LogicalDevice.id
-    ofp_flow_mod flow_mod = 2;
-}
-
-message FlowGroupTableUpdate {
-    string id = 1;  // Device.id or LogicalDevice.id
-    ofp_group_mod group_mod = 2;
-}
-
-message Flows {
-    repeated ofp_flow_stats items = 1;
-}
-
-message Meters {
-    repeated ofp_meter_entry items = 1;
-}
-
-message FlowGroups {
-    repeated ofp_group_entry items = 1;
-}
-
-message FlowChanges {
-    Flows to_add = 1;
-    Flows to_remove = 2;
-}
-
-message FlowGroupChanges {
-    FlowGroups to_add = 1;
-    FlowGroups to_remove = 2;
-    FlowGroups to_update = 3;
-}
-
-message PacketIn {
-    string id = 1;  // LogicalDevice.id
-    ofp_packet_in packet_in = 2;
-}
-
-message PacketOut {
-    string id = 1;  // LogicalDevice.id
-    ofp_packet_out packet_out = 2;
-}
-
-message ChangeEvent {
-    string id = 1; // LogicalDevice.id
-    oneof event {
-        ofp_port_status port_status = 2;
-    }
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openolt.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openolt.proto
deleted file mode 100644
index 8fd5789..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/openolt.proto
+++ /dev/null
@@ -1,486 +0,0 @@
-// Copyright (c) 2018 Open Networking Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at:
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/openolt";
-
-package openolt;
-import "google/api/annotations.proto";
-import public "voltha_protos/tech_profile.proto";
-
-service Openolt {
-
-    rpc DisableOlt(Empty) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/Disable"
-          body: "*"
-        };
-    }
-
-    rpc ReenableOlt(Empty) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/Reenable"
-          body: "*"
-        };
-    }
-
-    rpc ActivateOnu(Onu) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/EnableOnu"
-          body: "*"
-        };
-    }
-
-    rpc DeactivateOnu(Onu) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/DisableOnu"
-          body: "*"
-        };
-    }
-
-    rpc DeleteOnu(Onu) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/DeleteOnu"
-          body: "*"
-        };
-    }
-
-    rpc OmciMsgOut(OmciMsg) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/OmciMsgOut"
-          body: "*"
-        };
-    }
-
-    rpc OnuPacketOut(OnuPacket) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/OnuPacketOut"
-          body: "*"
-        };
-    }
-
-    rpc UplinkPacketOut(UplinkPacket) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/UplinkPacketOut"
-          body: "*"
-        };
-    }
-
-    rpc FlowAdd(Flow) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/FlowAdd"
-          body: "*"
-        };
-    }
-
-    rpc FlowRemove(Flow) returns (Empty) {
-        option (google.api.http) = {
-          post: "/v1/FlowRemove"
-          body: "*"
-        };
-    }
-
-    rpc HeartbeatCheck(Empty) returns (Heartbeat) {
-        option (google.api.http) = {
-          post: "/v1/HeartbeatCheck"
-          body: "*"
-        };
-    }
-
-    rpc EnablePonIf(Interface) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/EnablePonIf"
-            body: "*"
-        };
-    }
-
-    rpc DisablePonIf(Interface) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/DisablePonIf"
-            body: "*"
-        };
-    }
-
-    rpc GetDeviceInfo(Empty) returns (DeviceInfo) {
-        option (google.api.http) = {
-            post: "/v1/GetDeviceInfo"
-            body: "*"
-        };
-    }
-
-    rpc Reboot(Empty) returns (Empty) {
-         option (google.api.http) = {
-            post: "/v1/Reboot"
-            body: "*"
-        };
-    }
-
-    rpc CollectStatistics(Empty) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/CollectStatistics"
-            body: "*"
-        };
-    }
-
-    rpc CreateTrafficSchedulers(tech_profile.TrafficSchedulers) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/CreateTrafficSchedulers"
-            body: "*"
-        };
-    }
-
-    rpc RemoveTrafficSchedulers(tech_profile.TrafficSchedulers) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/RemoveTrafficSchedulers"
-            body: "*"
-        };
-    }
-
-    rpc CreateTrafficQueues(tech_profile.TrafficQueues) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/CreateTrafficQueues"
-            body: "*"
-        };
-    }
-
-    rpc RemoveTrafficQueues(tech_profile.TrafficQueues) returns (Empty) {
-        option (google.api.http) = {
-            post: "/v1/RemoveTrafficQueues"
-            body: "*"
-        };
-    }
-
-    rpc EnableIndication(Empty) returns (stream Indication) {}
-}
-
-message Indication {
-    oneof data {
-        OltIndication olt_ind = 1;
-        IntfIndication intf_ind = 2;
-        IntfOperIndication intf_oper_ind = 3;
-        OnuDiscIndication onu_disc_ind = 4;
-        OnuIndication onu_ind = 5;
-        OmciIndication omci_ind = 6;
-        PacketIndication pkt_ind = 7;
-        PortStatistics port_stats = 8;
-        FlowStatistics flow_stats = 9;
-        AlarmIndication alarm_ind= 10;
-    }
-}
-
-message AlarmIndication {
-    oneof data {
-        LosIndication los_ind = 1;
-        DyingGaspIndication dying_gasp_ind = 2;
-        OnuAlarmIndication onu_alarm_ind = 3;
-        OnuStartupFailureIndication onu_startup_fail_ind = 4;
-        OnuSignalDegradeIndication onu_signal_degrade_ind = 5;
-        OnuDriftOfWindowIndication onu_drift_of_window_ind = 6;
-        OnuLossOfOmciChannelIndication onu_loss_omci_ind = 7;
-        OnuSignalsFailureIndication onu_signals_fail_ind = 8;
-        OnuTransmissionInterferenceWarning onu_tiwi_ind = 9;
-        OnuActivationFailureIndication onu_activation_fail_ind = 10;
-        OnuProcessingErrorIndication onu_processing_error_ind = 11;
-    }
-}
-
-message OltIndication {
-    string oper_state = 1;	// up, down
-}
-
-message IntfIndication {
-    fixed32 intf_id = 1;
-    string oper_state = 2;      // up, down
-}
-
-message OnuDiscIndication {
-    fixed32 intf_id = 1;
-    SerialNumber serial_number = 2;
-}
-
-message OnuIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string oper_state = 3;      // up, down
-    string admin_state = 5;     // up, down
-    SerialNumber serial_number = 4;
-}
-
-message IntfOperIndication {
-    string type = 1;		// nni, pon
-    fixed32 intf_id = 2;
-    string oper_state = 3;      // up, down
-}
-
-message OmciIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    bytes pkt = 3;
-}
-
-message PacketIndication {
-    string intf_type = 5;		// nni, pon, unknown
-    fixed32 intf_id = 1;
-    fixed32 gemport_id = 2;
-    fixed32 flow_id = 3;
-    fixed32 port_no = 6;
-    fixed64 cookie = 7;
-    bytes pkt = 4;
-}
-
-message Interface {
-    fixed32 intf_id = 1;
-}
-
-message Heartbeat {
-    fixed32 heartbeat_signature = 1;
-}
-
-message Onu {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    SerialNumber serial_number = 3;
-    fixed32 pir = 4;   // peak information rate assigned to onu
-}
-
-message OmciMsg {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    bytes pkt = 3;
-}
-
-message OnuPacket {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    fixed32 port_no = 4;
-    fixed32 gemport_id = 5;
-    bytes pkt = 3;
-}
-
-message UplinkPacket {
-    fixed32 intf_id = 1;
-    bytes pkt = 2;
-}
-
-message DeviceInfo {
-    string vendor = 1;
-    string model = 2;
-    string hardware_version = 3;
-    string firmware_version = 4;
-    string device_id = 16;
-    string device_serial_number = 17;
-
-    // Total number of pon intf ports on the device
-    fixed32 pon_ports = 12;
-
-    // If using global per-device technology profile. To be deprecated
-    string technology = 5;
-    fixed32 onu_id_start = 6;
-    fixed32 onu_id_end = 7;
-    fixed32 alloc_id_start = 8;
-    fixed32 alloc_id_end = 9;
-    fixed32 gemport_id_start = 10;
-    fixed32 gemport_id_end = 11;
-    fixed32 flow_id_start = 13;
-    fixed32 flow_id_end = 14;
-
-    message DeviceResourceRanges {
-
-        // List of 0 or more intf_ids that use the same technology and pools.
-        // If 0 intf_ids supplied, it implies ALL interfaces
-        repeated fixed32 intf_ids = 1;
-
-        // Technology profile for this pool
-        string technology = 2;
-
-        message Pool {
-            enum PoolType {
-                ONU_ID = 0;
-                ALLOC_ID = 1;
-                GEMPORT_ID = 2;
-                FLOW_ID = 3;
-            }
-
-            enum SharingType {
-                DEDICATED_PER_INTF = 0;
-                SHARED_BY_ALL_INTF_ALL_TECH = 1; // Shared across all interfaces in all technologies in all ranges
-                SHARED_BY_ALL_INTF_SAME_TECH = 2; // Shared across all interfaces of the same technology used in this range
-            }
-
-            PoolType type = 1;
-	    SharingType sharing = 2;
-	    fixed32 start = 3; // lower bound on IDs allocated from this pool
-	    fixed32 end = 4; // upper bound on IDs allocated from this pool
-	}
-        repeated Pool pools = 3;
-    }
-    repeated DeviceResourceRanges ranges = 15;
-}
-
-message Classifier {
-    fixed32 o_tpid = 1;
-    fixed32 o_vid = 2;
-    fixed32 i_tpid = 3;
-    fixed32 i_vid = 4;
-    fixed32 o_pbits = 5;
-    fixed32 i_pbits = 6;
-    fixed32 eth_type = 7;
-    bytes dst_mac = 8;
-    bytes src_mac = 9;
-    fixed32 ip_proto = 10;
-    fixed32 dst_ip = 11;
-    fixed32 src_ip = 12;
-    fixed32 src_port = 13;
-    fixed32 dst_port = 14;
-    string pkt_tag_type = 15;	// untagged, single_tag, double_tag
-}
-
-message ActionCmd {
-    bool add_outer_tag = 1;
-    bool remove_outer_tag = 2;
-    bool trap_to_host = 3;
-}
-
-message Action {
-    ActionCmd cmd = 1;
-    fixed32 o_vid = 2;
-    fixed32 o_pbits = 3;
-    fixed32 o_tpid = 4;
-    fixed32 i_vid = 5;
-    fixed32 i_pbits = 6;
-    fixed32 i_tpid = 7;
-}
-
-message Flow {
-    sfixed32 access_intf_id = 1;
-    sfixed32 onu_id = 2;
-    sfixed32 uni_id = 11;
-    fixed32 flow_id = 3;
-    string flow_type = 4;	// upstream, downstream, broadcast, multicast
-    sfixed32 alloc_id = 10;
-    sfixed32 network_intf_id = 5;
-    sfixed32 gemport_id = 6;
-    Classifier classifier = 7;
-    Action action = 8;
-    sfixed32 priority = 9;
-    fixed64 cookie = 12; // must be provided for any flow with trap_to_host action. Returned in PacketIndication
-    fixed32 port_no = 13; // must be provided for any flow with trap_to_host action. Returned in PacketIndication
-}
-
-message SerialNumber {
-    bytes vendor_id = 1;
-    bytes vendor_specific = 2;
-}
-
-message PortStatistics {
-    fixed32 intf_id = 1;
-    fixed64 rx_bytes = 2;
-    fixed64 rx_packets = 3;
-    fixed64 rx_ucast_packets = 4;
-    fixed64 rx_mcast_packets = 5;
-    fixed64 rx_bcast_packets = 6;
-    fixed64 rx_error_packets = 7;
-    fixed64 tx_bytes = 8;
-    fixed64 tx_packets = 9;
-    fixed64 tx_ucast_packets = 10;
-    fixed64 tx_mcast_packets = 11;
-    fixed64 tx_bcast_packets = 12;
-    fixed64 tx_error_packets = 13;
-    fixed64 rx_crc_errors = 14;
-    fixed64 bip_errors = 15;
-    fixed32 timestamp = 16;
-}
-
-message FlowStatistics {
-    fixed32 flow_id = 1;
-    fixed64 rx_bytes = 2;
-    fixed64 rx_packets = 3;
-    fixed64 tx_bytes = 8;
-    fixed64 tx_packets = 9;
-    fixed32 timestamp = 16;
-}
-
-message LosIndication {
-    fixed32 intf_id = 1;
-    string status = 2;
-}
-
-message DyingGaspIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-}
-
-message OnuAlarmIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string los_status = 3;
-    string lob_status = 4;
-    string lopc_miss_status = 5;
-    string lopc_mic_error_status = 6;
-}
-
-message OnuStartupFailureIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-}
-
-message OnuSignalDegradeIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-    fixed32 inverse_bit_error_rate = 4;
-}
-
-message OnuDriftOfWindowIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-    fixed32 drift = 4;
-    fixed32 new_eqd = 5;
-}
-
-message OnuLossOfOmciChannelIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-}
-
-message OnuSignalsFailureIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-    fixed32 inverse_bit_error_rate = 4;
-}
-
-message OnuTransmissionInterferenceWarning {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    string status = 3;
-    fixed32 drift = 4;
-}
-
-message OnuActivationFailureIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-}
-
-message OnuProcessingErrorIndication {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-}
-
-message Empty {}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ponsim.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ponsim.proto
deleted file mode 100644
index d4cbaa2..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/ponsim.proto
+++ /dev/null
@@ -1,67 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/protobuf/empty.proto";
-import "voltha_protos/openflow_13.proto";
-
-
-message PonSimOnuDeviceInfo {
-    int32 uni_port = 1;
-    string serial_number = 2;
-}
-
-message PonSimDeviceInfo {
-    int32 nni_port = 1;
-    repeated PonSimOnuDeviceInfo onus = 2;
-}
-
-message FlowTable {
-    int32 port = 1;  // Used to address right device
-    repeated openflow_13.ofp_flow_stats flows = 2;
-}
-
-message PonSimFrame {
-    string id = 1;
-    bytes payload = 2;
-    int32 out_port = 3;
-}
-
-message PonSimPacketCounter {
-    string name = 1;
-    int64 value = 2;
-}
-
-message PonSimPortMetrics {
-    string port_name = 1;
-    repeated PonSimPacketCounter packets = 2;
-}
-
-message PonSimMetrics {
-    string device = 1;
-    repeated PonSimPortMetrics metrics = 2;
-}
-
-message PonSimMetricsRequest {
-    int32 port = 1;
-}
-
-service PonSim {
-    rpc SendFrame(PonSimFrame)
-        returns (google.protobuf.Empty) {}
-
-    rpc ReceiveFrames(google.protobuf.Empty)
-        returns (stream PonSimFrame) {}
-
-    rpc GetDeviceInfo(google.protobuf.Empty)
-        returns(PonSimDeviceInfo) {}
-
-    rpc UpdateFlowTable(FlowTable)
-        returns(google.protobuf.Empty) {}
-
-    rpc GetStats(google.protobuf.Empty)
-        returns(PonSimMetrics) {}
-
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/schema.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/schema.proto
deleted file mode 100644
index 2edd85a..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/schema.proto
+++ /dev/null
@@ -1,40 +0,0 @@
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/schema";
-
-package schema;
-
-import "google/api/annotations.proto";
-import "google/protobuf/empty.proto";
-
-// Contains the name and content of a *.proto file
-message ProtoFile {
-    string file_name = 1;  // name of proto file
-    string proto = 2;  // content of proto file
-    bytes descriptor = 3;  // compiled descriptor for proto (zlib compressed)
-}
-
-// Proto files and compiled descriptors for this interface
-message Schemas {
-
-    // Proto files
-    repeated ProtoFile protos = 1;
-
-    // Proto file name from which swagger.json shall be generated
-    string swagger_from = 2;
-
-    // Proto file name from which yang schemas shall be generated
-    string yang_from = 3;
-}
-
-// Schema services
-service SchemaService {
-
-    // Return active grpc schemas
-    rpc GetSchema(google.protobuf.Empty) returns (Schemas) {
-        option (google.api.http) = {
-            get: "/schema"
-        };
-    }
-
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/tech_profile.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/tech_profile.proto
deleted file mode 100644
index b91aeef..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/tech_profile.proto
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2018 Open Networking Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at:
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/tech_profile";
-
-package tech_profile;
-import "google/api/annotations.proto";
-
-enum Direction {
-    UPSTREAM = 0;
-    DOWNSTREAM = 1;
-    BIDIRECTIONAL = 2;
-}
-
-enum SchedulingPolicy {
-    WRR = 0;
-    StrictPriority = 1;
-    Hybrid = 2;
-}
-
-enum AdditionalBW {
-    AdditionalBW_None = 0;
-    AdditionalBW_NA = 1;
-    AdditionalBW_BestEffort = 2;
-    AdditionalBW_Auto = 3;
-}
-
-enum DiscardPolicy {
-    TailDrop = 0;
-    WTailDrop = 1;
-    Red = 2;
-    WRed = 3;
-}
-
-enum InferredAdditionBWIndication {
-    InferredAdditionBWIndication_None = 0;
-    InferredAdditionBWIndication_Assured = 1;
-    InferredAdditionBWIndication_BestEffort = 2;
-}
-
-message SchedulerConfig {
-    Direction direction = 1;
-    AdditionalBW additional_bw = 2; // Valid on for “direction == Upstream”.
-    fixed32 priority = 3;
-    fixed32 weight = 4;
-    SchedulingPolicy sched_policy = 5;
-}
-
-message TrafficShapingInfo {
-    fixed32 cir = 1;
-    fixed32 cbs = 2;
-    fixed32 pir = 3;
-    fixed32 pbs = 4;
-    fixed32 gir = 5; // only if “direction == Upstream ”
-    InferredAdditionBWIndication add_bw_ind = 6; // only if “direction == Upstream”
-}
-
-message TrafficScheduler {
-    Direction direction = 1;
-    fixed32 alloc_id = 2; // valid only if “direction == Upstream ”
-    SchedulerConfig scheduler = 3;
-    TrafficShapingInfo traffic_shaping_info = 4;
-}
-
-message TrafficSchedulers {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    fixed32 uni_id = 4;
-    fixed32 port_no = 5;
-    repeated TrafficScheduler traffic_scheds = 3;
-}
-
-message TailDropDiscardConfig {
-    fixed32 queue_size = 1;
-}
-
-message RedDiscardConfig {
-    fixed32 min_threshold = 1;
-    fixed32 max_threshold = 2;
-    fixed32 max_probability = 3;
-}
-
-message WRedDiscardConfig {
-    RedDiscardConfig green = 1;
-    RedDiscardConfig yellow = 2;
-    RedDiscardConfig red = 3;
-}
-
-message DiscardConfig {
-    DiscardPolicy discard_policy = 1;
-    oneof discard_config {
-        TailDropDiscardConfig tail_drop_discard_config = 2;
-        RedDiscardConfig red_discard_config = 3;
-        WRedDiscardConfig wred_discard_config = 4;
-    }
-}
-
-message TrafficQueue {
-    Direction direction = 1;
-    fixed32 gemport_id = 2;
-    string pbit_map = 3;
-    bool aes_encryption = 4;
-    SchedulingPolicy sched_policy = 5; // This can be SP or WRR
-    fixed32 priority = 6;
-    fixed32 weight = 7;
-    DiscardPolicy discard_policy = 8;
-    DiscardConfig discard_config = 9;
-}
-
-message TrafficQueues {
-    fixed32 intf_id = 1;
-    fixed32 onu_id = 2;
-    fixed32 uni_id = 4;
-    fixed32 port_no = 5;
-    repeated TrafficQueue traffic_queues = 6;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/voltha.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/voltha.proto
deleted file mode 100644
index 5e45033..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/voltha.proto
+++ /dev/null
@@ -1,614 +0,0 @@
-/*
- * Top-level Voltha API definition
- *
- * For details, see individual definition files.
- */
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/voltha";
-
-package voltha;
-
-import "google/api/annotations.proto";
-import "google/protobuf/empty.proto";
-
-import public "voltha_protos/meta.proto";
-import public "voltha_protos/common.proto";
-import public "voltha_protos/health.proto";
-import public "voltha_protos/logical_device.proto";
-import public "voltha_protos/device.proto";
-import public "voltha_protos/adapter.proto";
-import public "voltha_protos/openflow_13.proto";
-
-import "voltha_protos/omci_mib_db.proto";
-import "voltha_protos/omci_alarm_db.proto";
-import "voltha_protos/yang_options.proto";
-
-option java_package = "org.opencord.voltha";
-option java_outer_classname = "VolthaProtos";
-option csharp_namespace = "Opencord.Voltha.Voltha";
-
-message DeviceGroup {
-
-    string id = 1 [(access) = READ_ONLY];
-
-    repeated LogicalDevice logical_devices = 2 [(child_node) = {key: "id"}];
-
-    repeated Device devices = 3 [(child_node) = {key: "id"}];
-}
-
-message DeviceGroups {
-    repeated DeviceGroup items = 1;
-}
-
-
-message AlarmFilterRuleKey {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-    enum AlarmFilterRuleKey {
-        id = 0;
-        type = 1;
-        severity = 2;
-        resource_id = 3;
-        category = 4;
-        device_id = 5;
-    }
-}
-
-message AlarmFilterRule {
-    AlarmFilterRuleKey.AlarmFilterRuleKey key = 1;
-    string value = 2;
-}
-message AlarmFilter {
-    string id = 1 [(access) = READ_ONLY];
-
-    repeated AlarmFilterRule rules = 2;
-}
-
-message AlarmFilters {
-    repeated AlarmFilter filters = 1;
-}
-
-// CoreInstance represents a core instance.  It is data held in memory when a core
-// is running.  This data is not persistent.
-message CoreInstance {
-    option (common.yang_message_rule) = CREATE_BOTH_GROUPING_AND_CONTAINER;
-
-    string instance_id = 1  [(access) = READ_ONLY];
-
-    HealthStatus health = 2 [(child_node) = {}];
-
-}
-
-message CoreInstances {
-    option (common.yang_message_rule) = CREATE_BOTH_GROUPING_AND_CONTAINER;
-    repeated CoreInstance items = 1;
-}
-
-// Voltha represents the Voltha cluster data.  Each Core instance will hold a subset of
-// the entire cluster. However, some items (e.g. adapters) will be held by all cores
-// for better performance
-message Voltha {
-    option (common.yang_message_rule) = CREATE_BOTH_GROUPING_AND_CONTAINER;
-
-    string version = 1 [(access) = READ_ONLY];
-
-    repeated Adapter adapters = 2 [(child_node) = {key: "id"}];
-
-    repeated LogicalDevice logical_devices = 3 [(child_node) = {key: "id"}];
-
-    repeated Device devices = 4 [(child_node) = {key: "id"}];
-
-    repeated DeviceType device_types = 5 [(child_node) = {key: "id"}];
-
-    repeated DeviceGroup device_groups = 6 [(child_node) = {key: "id"}];
-
-    repeated AlarmFilter alarm_filters = 7 [(child_node) = {key: "id"}];
-
-    repeated
-        omci.MibDeviceData omci_mib_database = 28
-        [(child_node) = {key: "device_id"}];
-
-    repeated
-        omci.AlarmDeviceData omci_alarm_database = 29
-        [(child_node) = {key: "device_id"}];
-}
-
-// Device Self Test Response
-message SelfTestResponse {
-    option (common.yang_child_rule) = MOVE_TO_PARENT_LEVEL;
-
-	enum SelfTestResult  {
-	    SUCCESS = 0;
-	    FAILURE = 1;
-	    NOT_SUPPORTED = 2;
-	    UNKNOWN_ERROR = 3;
-    }
-    SelfTestResult result = 1;
-}
-
-message OfAgentSubscriber {
-    // ID of ofagent instance
-    string ofagent_id = 1;
-
-    // ID of voltha instance to which the ofagent is subscribed
-    string voltha_id = 2;
-}
-
-// Identifies a membership group a Core belongs to
-message Membership {
-    //  Group name
-    string group_name = 1;
-
-    // Unique ID of a container within that group
-    string id = 2;
-}
-
-// Additional information required to process flow at device adapters
-message FlowMetadata {
-    // Meters associated with flow-update to adapter
-    repeated openflow_13.ofp_meter_config meters = 1;
-}
-
-/*
- * Voltha APIs
- *
- */
-service VolthaService {
-
-    // Get more information on a given physical device
-    rpc UpdateLogLevel(common.Logging) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logs"
-            body: "*"
-        };
-    }
-
-    rpc GetLogLevels(common.LoggingComponent) returns (common.Loggings) {
-        option (google.api.http) = {
-            get: "/api/v1/logs"
-        };
-    }
-
-    // Get the membership group of a Voltha Core
-    rpc GetMembership(google.protobuf.Empty) returns(Membership) {
-        option (google.api.http) = {
-            get: "/api/v1/membership"
-        };
-    }
-
-    // Set the membership group of a Voltha Core
-    rpc UpdateMembership(Membership) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/membership"
-            body: "*"
-        };
-    }
-
-    // Get high level information on the Voltha cluster
-    rpc GetVoltha(google.protobuf.Empty) returns(Voltha) {
-        option (google.api.http) = {
-            get: "/api/v1"
-        };
-    }
-
-    // List all Voltha cluster core instances
-    rpc ListCoreInstances(google.protobuf.Empty) returns(CoreInstances) {
-        option (google.api.http) = {
-            get: "/api/v1/instances"
-        };
-        option (common.yang_xml_tag).xml_tag = 'items';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // Get details on a Voltha cluster instance
-    rpc GetCoreInstance(common.ID) returns(CoreInstance) {
-        option (google.api.http) = {
-            get: "/api/v1/instances/{id}"
-        };
-    }
-
-    // List all active adapters (plugins) in the Voltha cluster
-    rpc ListAdapters(google.protobuf.Empty) returns(Adapters) {
-        option (google.api.http) = {
-            get: "/api/v1/adapters"
-        };
-        option (common.yang_xml_tag).xml_tag = 'adapters';
-    }
-
-
-    // List all logical devices managed by the Voltha cluster
-    rpc ListLogicalDevices(google.protobuf.Empty) returns(LogicalDevices) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices"
-        };
-        option (common.yang_xml_tag).xml_tag = 'logical_devices';
-    }
-
-    // Get additional information on a given logical device
-    rpc GetLogicalDevice(common.ID) returns(LogicalDevice) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}"
-        };
-    }
-
-    // List ports of a logical device
-    rpc ListLogicalDevicePorts(common.ID) returns(LogicalPorts) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}/ports"
-        };
-        option (common.yang_xml_tag).xml_tag = 'ports';
-    }
-
-    // Gets a logical device port
-    rpc GetLogicalDevicePort(LogicalPortId) returns(LogicalPort) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}/ports/{port_id}"
-        };
-        option (common.yang_xml_tag).xml_tag = 'port';
-    }
-
-    // Enables a logical device port
-    rpc EnableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logical_devices/{id}/ports/{port_id}/enable"
-        };
-    }
-
-    // Disables a logical device port
-    rpc DisableLogicalDevicePort(LogicalPortId) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logical_devices/{id}/ports/{port_id}/disable"
-        };
-    }
-
-    // List all flows of a logical device
-    rpc ListLogicalDeviceFlows(common.ID) returns(openflow_13.Flows) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}/flows"
-        };
-        option (common.yang_xml_tag).xml_tag = 'flows';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // Update flow table for logical device
-    rpc UpdateLogicalDeviceFlowTable(openflow_13.FlowTableUpdate)
-            returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logical_devices/{id}/flows"
-            body: "*"
-        };
-    }
-
-    // Update meter table for logical device
-    rpc UpdateLogicalDeviceMeterTable(openflow_13.MeterModUpdate)
-            returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logical_devices/{id}/meters"
-            body: "*"
-        };
-    }
-
-    // List all meters of a logical device
-    rpc ListLogicalDeviceMeters(common.ID) returns (openflow_13.Meters) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}/meters"
-        };
-        option (common.yang_xml_tag).xml_tag = 'meters';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // List all flow groups of a logical device
-    rpc ListLogicalDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
-        option (google.api.http) = {
-            get: "/api/v1/logical_devices/{id}/flow_groups"
-        };
-        option (common.yang_xml_tag).xml_tag = 'flow_groups';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // Update group table for device
-    rpc UpdateLogicalDeviceFlowGroupTable(openflow_13.FlowGroupTableUpdate)
-            returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/logical_devices/{id}/flow_groups"
-            body: "*"
-        };
-    }
-
-    // List all physical devices controlled by the Voltha cluster
-    rpc ListDevices(google.protobuf.Empty) returns(Devices) {
-        option (google.api.http) = {
-            get: "/api/v1/devices"
-        };
-        option (common.yang_xml_tag).xml_tag = 'devices';
-    }
-
-    // List all physical devices IDs controlled by the Voltha cluster
-    rpc ListDeviceIds(google.protobuf.Empty) returns(common.IDs) {
-        option (google.api.http) = {
-            get: "/api/v1/deviceids"
-        };
-        option (common.yang_xml_tag).xml_tag = 'id';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // Request to a voltha Core to reconcile a set of devices based on their IDs
-    rpc ReconcileDevices(common.IDs) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/deviceids"
-            body: "*"
-        };
-    }
-
-    // Get more information on a given physical device
-    rpc GetDevice(common.ID) returns(Device) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}"
-        };
-    }
-
-    // Pre-provision a new physical device
-    rpc CreateDevice(Device) returns(Device) {
-        option (google.api.http) = {
-            post: "/api/v1/devices"
-            body: "*"
-        };
-    }
-
-    // Enable a device.  If the device was in pre-provisioned state then it
-    // will transition to ENABLED state.  If it was is DISABLED state then it
-    // will transition to ENABLED state as well.
-    rpc EnableDevice(common.ID) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/enable"
-        };
-    }
-
-    // Disable a device
-    rpc DisableDevice(common.ID) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/disable"
-        };
-    }
-
-    // Reboot a device
-    rpc RebootDevice(common.ID) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/reboot"
-        };
-    }
-
-    // Delete a device
-    rpc DeleteDevice(common.ID) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            delete: "/api/v1/devices/{id}/delete"
-        };
-    }
-
-    // Request an image download to the standby partition
-    // of a device.
-    // Note that the call is expected to be non-blocking.
-    rpc DownloadImage(ImageDownload) returns(common.OperationResp) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/image_downloads/{name}"
-            body: "*"
-        };
-    }
-
-    // Get image download status on a device
-    // The request retrieves progress on device and updates db record
-    rpc GetImageDownloadStatus(ImageDownload) returns(ImageDownload) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/image_downloads/{name}/status"
-        };
-    }
-
-    // Get image download db record
-    rpc GetImageDownload(ImageDownload) returns(ImageDownload) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/image_downloads/{name}"
-        };
-    }
-
-    // List image download db records for a given device
-    rpc ListImageDownloads(common.ID) returns(ImageDownloads) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/image_downloads"
-        };
-    }
-
-    // Cancel an existing image download process on a device
-    rpc CancelImageDownload(ImageDownload) returns(common.OperationResp) {
-        option (google.api.http) = {
-            delete: "/api/v1/devices/{id}/image_downloads/{name}"
-        };
-    }
-
-    // Activate the specified image at a standby partition
-    // to active partition.
-    // Depending on the device implementation, this call
-    // may or may not cause device reboot.
-    // If no reboot, then a reboot is required to make the
-    // activated image running on device
-    // Note that the call is expected to be non-blocking.
-    rpc ActivateImageUpdate(ImageDownload) returns(common.OperationResp) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/image_downloads/{name}/image_update"
-            body: "*"
-        };
-    }
-
-    // Revert the specified image at standby partition
-    // to active partition, and revert to previous image
-    // Depending on the device implementation, this call
-    // may or may not cause device reboot.
-    // If no reboot, then a reboot is required to make the
-    // previous image running on device
-    // Note that the call is expected to be non-blocking.
-    rpc RevertImageUpdate(ImageDownload) returns(common.OperationResp) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/image_downloads/{name}/image_revert"
-            body: "*"
-        };
-    }
-
-    // List ports of a device
-    rpc ListDevicePorts(common.ID) returns(Ports) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/ports"
-        };
-        option (common.yang_xml_tag).xml_tag = 'ports';
-    }
-
-    // List pm config of a device
-    rpc ListDevicePmConfigs(common.ID) returns(PmConfigs) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/pm_configs"
-        };
-    }
-
-    // Update the pm config of a device
-    rpc UpdateDevicePmConfigs(voltha.PmConfigs) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/pm_configs"
-            body: "*"
-        };
-    }
-
-    // List all flows of a device
-    rpc ListDeviceFlows(common.ID) returns(openflow_13.Flows) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/flows"
-        };
-        option (common.yang_xml_tag).xml_tag = 'flows';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // List all flow groups of a device
-    rpc ListDeviceFlowGroups(common.ID) returns(openflow_13.FlowGroups) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/flow_groups"
-        };
-        option (common.yang_xml_tag).xml_tag = 'flow_groups';
-        option (common.yang_xml_tag).list_items_name = 'items';
-    }
-
-    // List device types known to Voltha
-    rpc ListDeviceTypes(google.protobuf.Empty) returns(DeviceTypes) {
-        option (google.api.http) = {
-            get: "/api/v1/device_types"
-        };
-        option (common.yang_xml_tag).xml_tag = 'device_types';
-    }
-
-    // Get additional information on a device type
-    rpc GetDeviceType(common.ID) returns(DeviceType) {
-        option (google.api.http) = {
-            get: "/api/v1/device_types/{id}"
-        };
-    }
-
-    // List all device sharding groups
-    rpc ListDeviceGroups(google.protobuf.Empty) returns(DeviceGroups) {
-        option (google.api.http) = {
-            get: "/api/v1/device_groups"
-        };
-        option (common.yang_xml_tag).xml_tag = 'device_groups';
-    }
-
-    // Stream control packets to the dataplane
-    rpc StreamPacketsOut(stream openflow_13.PacketOut)
-        returns(google.protobuf.Empty) {
-        // This does not have an HTTP representation
-    }
-
-    // Receive control packet stream
-    rpc ReceivePacketsIn(google.protobuf.Empty)
-        returns(stream openflow_13.PacketIn) {
-        // This does not have an HTTP representation
-    }
-
-    rpc ReceiveChangeEvents(google.protobuf.Empty)
-        returns(stream openflow_13.ChangeEvent) {
-        // This does not have an HTTP representation
-    }
-
-    // Get additional information on a device group
-    rpc GetDeviceGroup(common.ID) returns(DeviceGroup) {
-        option (google.api.http) = {
-            get: "/api/v1/device_groups/{id}"
-        };
-    }
-
-    rpc CreateAlarmFilter(AlarmFilter) returns(AlarmFilter) {
-        option (google.api.http) = {
-            post: "/api/v1/alarm_filters"
-            body: "*"
-        };
-    }
-
-    rpc GetAlarmFilter(common.ID) returns(AlarmFilter) {
-        option (google.api.http) = {
-            get: "/api/v1/alarm_filters/{id}"
-        };
-    }
-
-    rpc UpdateAlarmFilter(AlarmFilter) returns(AlarmFilter) {
-        option (google.api.http) = {
-            put: "/api/v1/alarm_filters/{id}"
-            body: "*"
-        };
-    }
-
-    rpc DeleteAlarmFilter(common.ID) returns(google.protobuf.Empty) {
-        option (google.api.http) = {
-            delete: "/api/v1/alarm_filters/{id}"
-        };
-    }
-
-    rpc ListAlarmFilters(google.protobuf.Empty) returns(AlarmFilters) {
-        option (google.api.http) = {
-            get: "/api/v1/alarm_filters"
-        };
-    }
-
-    rpc GetImages(common.ID) returns(Images) {
-        option (google.api.http) = {
-            get: "/api/v1/devices/{id}/images"
-        };
-    }
-
-    rpc SelfTest(common.ID) returns(SelfTestResponse) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/self_test"
-        };
-    }
-
-    // OpenOMCI MIB information
-    rpc GetMibDeviceData(common.ID) returns(omci.MibDeviceData) {
-        option (google.api.http) = {
-            get: "/api/v1/openomci/{id}/mib"
-        };
-    }
-
-    // OpenOMCI ALARM information
-    rpc GetAlarmDeviceData(common.ID) returns(omci.AlarmDeviceData) {
-        option (google.api.http) = {
-            get: "/api/v1/openomci/{id}/alarm"
-        };
-    }
-
-    // Simulate an Alarm
-    rpc SimulateAlarm(SimulateAlarmRequest) returns(common.OperationResp) {
-        option (google.api.http) = {
-            post: "/api/v1/devices/{id}/simulate_larm"
-            body: "*"
-        };
-    }
-    rpc Subscribe (OfAgentSubscriber) returns (OfAgentSubscriber) {
-    }
-
-}
-
diff --git a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/yang_options.proto b/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/yang_options.proto
deleted file mode 100644
index 9c83149..0000000
--- a/vendor/github.com/opencord/voltha-protos/protos/voltha_protos/yang_options.proto
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2015, Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// This file contains annotation definitions that can be used to describe
-// a configuration tree.
-
-syntax = "proto3";
-
-option go_package = "github.com/opencord/voltha-protos/go/common";
-
-package common;
-
-import "google/protobuf/descriptor.proto";
-
-enum MessageParserOption {
-    // Move any enclosing child enum/message definition to the same level
-    // as the parent (this message) in the yang generated file
-    MOVE_TO_PARENT_LEVEL= 0;
-
-    // Create both a grouping and a container for this message.  The container
-    // name will be the message name.  The grouping name will be the message
-    // name prefixed with "grouping_"
-    CREATE_BOTH_GROUPING_AND_CONTAINER = 1;
-}
-
-message InlineNode {
-    string id = 1;
-    string type = 2;
-}
-
-message RpcReturnDef {
-    // The gRPC methods return message types.  NETCONF expects an actual
-    // attribute as defined in the YANG schema.  The xnl_tag will be used
-    // as the top most tag when translating a gRPC response into an xml
-    // response
-    string xml_tag = 1;
-
-    // When the gRPC response is a list of items, we need to differentiate
-    // between a YANG schema attribute whose name is "items" and when "items"
-    // is used only to indicate a list of items is being returned.  The default
-    // behavior assumes a list is returned when "items" is present in
-    // the response.  This option will therefore be used when the attribute
-    // name in the YANG schema is 'items'
-    string list_items_name = 2;
-}
-
-extend google.protobuf.MessageOptions {
-    // This annotation is used to indicate how a message is parsed when
-    // converting from proto to yang format.
-    MessageParserOption yang_child_rule = 7761774;
-
-    MessageParserOption yang_message_rule = 7761775;
-}
-
-extend google.protobuf.FieldOptions {
-    // If present, the field (a message reference) should be replaced by the
-    // message itself.  For now, this applies only to non-repeated fields.
-    InlineNode yang_inline_node = 7761776;
-}
-
-extend google.protobuf.MethodOptions {
-    RpcReturnDef yang_xml_tag = 7761777;
-}
diff --git a/vendor/github.com/opencord/voltha-protos/protoset.go b/vendor/github.com/opencord/voltha-protos/protoset.go
new file mode 100644
index 0000000..2ab256d
--- /dev/null
+++ b/vendor/github.com/opencord/voltha-protos/protoset.go
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2018-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * Import this file into a go project in order to cause `go mod vendor`
+ * to vendor the voltha.pb file.
+ */
+
+package volthaGoProtoSet;
diff --git a/vendor/github.com/opencord/voltha-protos/python/__init__.py b/vendor/github.com/opencord/voltha-protos/python/__init__.py
deleted file mode 100644
index 19d1424..0000000
--- a/vendor/github.com/opencord/voltha-protos/python/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2019-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/vendor/github.com/opencord/voltha-protos/python/test/__init__.py b/vendor/github.com/opencord/voltha-protos/python/test/__init__.py
deleted file mode 100644
index 19d1424..0000000
--- a/vendor/github.com/opencord/voltha-protos/python/test/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2019-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/vendor/github.com/opencord/voltha-protos/python/test/test_protos.py b/vendor/github.com/opencord/voltha-protos/python/test/test_protos.py
deleted file mode 100644
index 552d5b5..0000000
--- a/vendor/github.com/opencord/voltha-protos/python/test/test_protos.py
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2019-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-from __future__ import absolute_import, print_function
-import unittest
-
-from google.api import annotations_pb2
-from voltha_protos import voltha_pb2
-
-print("imported api annotations properly")
-
-
-class TestProtos(unittest.TestCase):
-
-    @classmethod
-    def setUpClass(self):
-        print("in setup")
-
-    def test_proto_call(self):
-        """ initialization """
-
-        image_downloader = voltha_pb2.ImageDownload()
-
-        self.assertIsNotNone(image_downloader)
-
diff --git a/vendor/github.com/opencord/voltha-protos/python/voltha_protos/__init__.py b/vendor/github.com/opencord/voltha-protos/python/voltha_protos/__init__.py
deleted file mode 100644
index 19d1424..0000000
--- a/vendor/github.com/opencord/voltha-protos/python/voltha_protos/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2019-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
diff --git a/vendor/github.com/opencord/voltha-protos/test/test-go-proto-consistency.sh b/vendor/github.com/opencord/voltha-protos/test/test-go-proto-consistency.sh
deleted file mode 100755
index 9d238df..0000000
--- a/vendor/github.com/opencord/voltha-protos/test/test-go-proto-consistency.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/env bash
-
-# Copyright 2018 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# test-go-proto-consistency.sh
-#
-# This test validates that go proto outputs are committed to git.  It does this
-# by regenerating them and validating whether git thinks they are the same. If
-# they become out of sync, there can be problems for consumers of the protos.
-
-set -eu -o pipefail
-
-git status > /dev/null
-STAGED="$(git diff-index --quiet HEAD -- || echo 'staged')"
-UNTRACKED="$(git ls-files --exclude-standard --others)"
-
-if [ "$STAGED" == "staged" ] || [ "$UNTRACKED" != "" ]; then
-    echo "Please commit or ignore local changes before executing this test"
-    git status
-    exit 1
-fi
-
-# delete and regenerate go protos
-rm -rf go/voltha.pb go/*/*.pb.go go_temp
-make go-protos
-
-# Running git status ensures correct git diff-index picks up changes
-git status > /dev/null
-STAGED_POST="$(git diff-index --quiet HEAD -- || echo "staged")"
-UNTRACKED_POST="$(git ls-files --exclude-standard --others)"
-
-if [ "$STAGED_POST" == "staged" ] || [ "$UNTRACKED_POST" != "" ] ; then
-    echo "You have go proto build outputs that are not committed."
-    echo "Check git status and commit updated files."
-    git status
-    exit 1
-else
-    echo "Test successful. All go proto build outputs are committed"
-    exit 0
-fi
-
diff --git a/vendor/github.com/opencord/voltha-protos/go/voltha.pb b/vendor/github.com/opencord/voltha-protos/voltha.pb
similarity index 100%
rename from vendor/github.com/opencord/voltha-protos/go/voltha.pb
rename to vendor/github.com/opencord/voltha-protos/voltha.pb
Binary files differ
diff --git a/vendor/github.com/petar/GoLLRB/AUTHORS b/vendor/github.com/petar/GoLLRB/AUTHORS
deleted file mode 100644
index 78d1de4..0000000
--- a/vendor/github.com/petar/GoLLRB/AUTHORS
+++ /dev/null
@@ -1,4 +0,0 @@
-Petar Maymounkov <petar@5ttt.org>
-Vadim Vygonets <vadik@vygo.net>
-Ian Smith <iansmith@acm.org>
-Martin Bruse
diff --git a/vendor/github.com/petar/GoLLRB/LICENSE b/vendor/github.com/petar/GoLLRB/LICENSE
deleted file mode 100644
index b75312c..0000000
--- a/vendor/github.com/petar/GoLLRB/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2010, Petar Maymounkov
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-(*) Redistributions of source code must retain the above copyright notice, this list
-of conditions and the following disclaimer.
-
-(*) Redistributions in binary form must reproduce the above copyright notice, this
-list of conditions and the following disclaimer in the documentation and/or
-other materials provided with the distribution.
-
-(*) Neither the name of Petar Maymounkov nor the names of its contributors may be
-used to endorse or promote products derived from this software without specific
-prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go b/vendor/github.com/petar/GoLLRB/llrb/avgvar.go
deleted file mode 100644
index 2d7e2a3..0000000
--- a/vendor/github.com/petar/GoLLRB/llrb/avgvar.go
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2010 Petar Maymounkov. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package llrb
-
-import "math"
-
-// avgVar maintains the average and variance of a stream of numbers
-// in a space-efficient manner.
-type avgVar struct {
-	count      int64
-	sum, sumsq float64
-}
-
-func (av *avgVar) Init() {
-	av.count = 0
-	av.sum = 0.0
-	av.sumsq = 0.0
-}
-
-func (av *avgVar) Add(sample float64) {
-	av.count++
-	av.sum += sample
-	av.sumsq += sample * sample
-}
-
-func (av *avgVar) GetCount() int64 { return av.count }
-
-func (av *avgVar) GetAvg() float64 { return av.sum / float64(av.count) }
-
-func (av *avgVar) GetTotal() float64 { return av.sum }
-
-func (av *avgVar) GetVar() float64 {
-	a := av.GetAvg()
-	return av.sumsq/float64(av.count) - a*a
-}
-
-func (av *avgVar) GetStdDev() float64 { return math.Sqrt(av.GetVar()) }
diff --git a/vendor/github.com/petar/GoLLRB/llrb/iterator.go b/vendor/github.com/petar/GoLLRB/llrb/iterator.go
deleted file mode 100644
index ee7b27f..0000000
--- a/vendor/github.com/petar/GoLLRB/llrb/iterator.go
+++ /dev/null
@@ -1,93 +0,0 @@
-package llrb
-
-type ItemIterator func(i Item) bool
-
-//func (t *Tree) Ascend(iterator ItemIterator) {
-//	t.AscendGreaterOrEqual(Inf(-1), iterator)
-//}
-
-func (t *LLRB) AscendRange(greaterOrEqual, lessThan Item, iterator ItemIterator) {
-	t.ascendRange(t.root, greaterOrEqual, lessThan, iterator)
-}
-
-func (t *LLRB) ascendRange(h *Node, inf, sup Item, iterator ItemIterator) bool {
-	if h == nil {
-		return true
-	}
-	if !less(h.Item, sup) {
-		return t.ascendRange(h.Left, inf, sup, iterator)
-	}
-	if less(h.Item, inf) {
-		return t.ascendRange(h.Right, inf, sup, iterator)
-	}
-
-	if !t.ascendRange(h.Left, inf, sup, iterator) {
-		return false
-	}
-	if !iterator(h.Item) {
-		return false
-	}
-	return t.ascendRange(h.Right, inf, sup, iterator)
-}
-
-// AscendGreaterOrEqual will call iterator once for each element greater or equal to
-// pivot in ascending order. It will stop whenever the iterator returns false.
-func (t *LLRB) AscendGreaterOrEqual(pivot Item, iterator ItemIterator) {
-	t.ascendGreaterOrEqual(t.root, pivot, iterator)
-}
-
-func (t *LLRB) ascendGreaterOrEqual(h *Node, pivot Item, iterator ItemIterator) bool {
-	if h == nil {
-		return true
-	}
-	if !less(h.Item, pivot) {
-		if !t.ascendGreaterOrEqual(h.Left, pivot, iterator) {
-			return false
-		}
-		if !iterator(h.Item) {
-			return false
-		}
-	}
-	return t.ascendGreaterOrEqual(h.Right, pivot, iterator)
-}
-
-func (t *LLRB) AscendLessThan(pivot Item, iterator ItemIterator) {
-	t.ascendLessThan(t.root, pivot, iterator)
-}
-
-func (t *LLRB) ascendLessThan(h *Node, pivot Item, iterator ItemIterator) bool {
-	if h == nil {
-		return true
-	}
-	if !t.ascendLessThan(h.Left, pivot, iterator) {
-		return false
-	}
-	if !iterator(h.Item) {
-		return false
-	}
-	if less(h.Item, pivot) {
-		return t.ascendLessThan(h.Left, pivot, iterator)
-	}
-	return true
-}
-
-// DescendLessOrEqual will call iterator once for each element less than the
-// pivot in descending order. It will stop whenever the iterator returns false.
-func (t *LLRB) DescendLessOrEqual(pivot Item, iterator ItemIterator) {
-	t.descendLessOrEqual(t.root, pivot, iterator)
-}
-
-func (t *LLRB) descendLessOrEqual(h *Node, pivot Item, iterator ItemIterator) bool {
-	if h == nil {
-		return true
-	}
-	if less(h.Item, pivot) || !less(pivot, h.Item) {
-		if !t.descendLessOrEqual(h.Right, pivot, iterator) {
-			return false
-		}
-		if !iterator(h.Item) {
-			return false
-		}
-	}
-	return t.descendLessOrEqual(h.Left, pivot, iterator)
-}
diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go b/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go
deleted file mode 100644
index 47126a3..0000000
--- a/vendor/github.com/petar/GoLLRB/llrb/llrb-stats.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2010 Petar Maymounkov. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package llrb
-
-// GetHeight() returns an item in the tree with key @key, and it's height in the tree
-func (t *LLRB) GetHeight(key Item) (result Item, depth int) {
-	return t.getHeight(t.root, key)
-}
-
-func (t *LLRB) getHeight(h *Node, item Item) (Item, int) {
-	if h == nil {
-		return nil, 0
-	}
-	if less(item, h.Item) {
-		result, depth := t.getHeight(h.Left, item)
-		return result, depth + 1
-	}
-	if less(h.Item, item) {
-		result, depth := t.getHeight(h.Right, item)
-		return result, depth + 1
-	}
-	return h.Item, 0
-}
-
-// HeightStats() returns the average and standard deviation of the height
-// of elements in the tree
-func (t *LLRB) HeightStats() (avg, stddev float64) {
-	av := &avgVar{}
-	heightStats(t.root, 0, av)
-	return av.GetAvg(), av.GetStdDev()
-}
-
-func heightStats(h *Node, d int, av *avgVar) {
-	if h == nil {
-		return
-	}
-	av.Add(float64(d))
-	if h.Left != nil {
-		heightStats(h.Left, d+1, av)
-	}
-	if h.Right != nil {
-		heightStats(h.Right, d+1, av)
-	}
-}
diff --git a/vendor/github.com/petar/GoLLRB/llrb/llrb.go b/vendor/github.com/petar/GoLLRB/llrb/llrb.go
deleted file mode 100644
index 81373fb..0000000
--- a/vendor/github.com/petar/GoLLRB/llrb/llrb.go
+++ /dev/null
@@ -1,456 +0,0 @@
-// Copyright 2010 Petar Maymounkov. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// A Left-Leaning Red-Black (LLRB) implementation of 2-3 balanced binary search trees,
-// based on the following work:
-//
-//   http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf
-//   http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf
-//   http://www.cs.princeton.edu/~rs/talks/LLRB/Java/RedBlackBST.java
-//
-//  2-3 trees (and the run-time equivalent 2-3-4 trees) are the de facto standard BST
-//  algoritms found in implementations of Python, Java, and other libraries. The LLRB
-//  implementation of 2-3 trees is a recent improvement on the traditional implementation,
-//  observed and documented by Robert Sedgewick.
-//
-package llrb
-
-// Tree is a Left-Leaning Red-Black (LLRB) implementation of 2-3 trees
-type LLRB struct {
-	count int
-	root  *Node
-}
-
-type Node struct {
-	Item
-	Left, Right *Node // Pointers to left and right child nodes
-	Black       bool  // If set, the color of the link (incoming from the parent) is black
-	// In the LLRB, new nodes are always red, hence the zero-value for node
-}
-
-type Item interface {
-	Less(than Item) bool
-}
-
-//
-func less(x, y Item) bool {
-	if x == pinf {
-		return false
-	}
-	if x == ninf {
-		return true
-	}
-	return x.Less(y)
-}
-
-// Inf returns an Item that is "bigger than" any other item, if sign is positive.
-// Otherwise  it returns an Item that is "smaller than" any other item.
-func Inf(sign int) Item {
-	if sign == 0 {
-		panic("sign")
-	}
-	if sign > 0 {
-		return pinf
-	}
-	return ninf
-}
-
-var (
-	ninf = nInf{}
-	pinf = pInf{}
-)
-
-type nInf struct{}
-
-func (nInf) Less(Item) bool {
-	return true
-}
-
-type pInf struct{}
-
-func (pInf) Less(Item) bool {
-	return false
-}
-
-// New() allocates a new tree
-func New() *LLRB {
-	return &LLRB{}
-}
-
-// SetRoot sets the root node of the tree.
-// It is intended to be used by functions that deserialize the tree.
-func (t *LLRB) SetRoot(r *Node) {
-	t.root = r
-}
-
-// Root returns the root node of the tree.
-// It is intended to be used by functions that serialize the tree.
-func (t *LLRB) Root() *Node {
-	return t.root
-}
-
-// Len returns the number of nodes in the tree.
-func (t *LLRB) Len() int { return t.count }
-
-// Has returns true if the tree contains an element whose order is the same as that of key.
-func (t *LLRB) Has(key Item) bool {
-	return t.Get(key) != nil
-}
-
-// Get retrieves an element from the tree whose order is the same as that of key.
-func (t *LLRB) Get(key Item) Item {
-	h := t.root
-	for h != nil {
-		switch {
-		case less(key, h.Item):
-			h = h.Left
-		case less(h.Item, key):
-			h = h.Right
-		default:
-			return h.Item
-		}
-	}
-	return nil
-}
-
-// Min returns the minimum element in the tree.
-func (t *LLRB) Min() Item {
-	h := t.root
-	if h == nil {
-		return nil
-	}
-	for h.Left != nil {
-		h = h.Left
-	}
-	return h.Item
-}
-
-// Max returns the maximum element in the tree.
-func (t *LLRB) Max() Item {
-	h := t.root
-	if h == nil {
-		return nil
-	}
-	for h.Right != nil {
-		h = h.Right
-	}
-	return h.Item
-}
-
-func (t *LLRB) ReplaceOrInsertBulk(items ...Item) {
-	for _, i := range items {
-		t.ReplaceOrInsert(i)
-	}
-}
-
-func (t *LLRB) InsertNoReplaceBulk(items ...Item) {
-	for _, i := range items {
-		t.InsertNoReplace(i)
-	}
-}
-
-// ReplaceOrInsert inserts item into the tree. If an existing
-// element has the same order, it is removed from the tree and returned.
-func (t *LLRB) ReplaceOrInsert(item Item) Item {
-	if item == nil {
-		panic("inserting nil item")
-	}
-	var replaced Item
-	t.root, replaced = t.replaceOrInsert(t.root, item)
-	t.root.Black = true
-	if replaced == nil {
-		t.count++
-	}
-	return replaced
-}
-
-func (t *LLRB) replaceOrInsert(h *Node, item Item) (*Node, Item) {
-	if h == nil {
-		return newNode(item), nil
-	}
-
-	h = walkDownRot23(h)
-
-	var replaced Item
-	if less(item, h.Item) { // BUG
-		h.Left, replaced = t.replaceOrInsert(h.Left, item)
-	} else if less(h.Item, item) {
-		h.Right, replaced = t.replaceOrInsert(h.Right, item)
-	} else {
-		replaced, h.Item = h.Item, item
-	}
-
-	h = walkUpRot23(h)
-
-	return h, replaced
-}
-
-// InsertNoReplace inserts item into the tree. If an existing
-// element has the same order, both elements remain in the tree.
-func (t *LLRB) InsertNoReplace(item Item) {
-	if item == nil {
-		panic("inserting nil item")
-	}
-	t.root = t.insertNoReplace(t.root, item)
-	t.root.Black = true
-	t.count++
-}
-
-func (t *LLRB) insertNoReplace(h *Node, item Item) *Node {
-	if h == nil {
-		return newNode(item)
-	}
-
-	h = walkDownRot23(h)
-
-	if less(item, h.Item) {
-		h.Left = t.insertNoReplace(h.Left, item)
-	} else {
-		h.Right = t.insertNoReplace(h.Right, item)
-	}
-
-	return walkUpRot23(h)
-}
-
-// Rotation driver routines for 2-3 algorithm
-
-func walkDownRot23(h *Node) *Node { return h }
-
-func walkUpRot23(h *Node) *Node {
-	if isRed(h.Right) && !isRed(h.Left) {
-		h = rotateLeft(h)
-	}
-
-	if isRed(h.Left) && isRed(h.Left.Left) {
-		h = rotateRight(h)
-	}
-
-	if isRed(h.Left) && isRed(h.Right) {
-		flip(h)
-	}
-
-	return h
-}
-
-// Rotation driver routines for 2-3-4 algorithm
-
-func walkDownRot234(h *Node) *Node {
-	if isRed(h.Left) && isRed(h.Right) {
-		flip(h)
-	}
-
-	return h
-}
-
-func walkUpRot234(h *Node) *Node {
-	if isRed(h.Right) && !isRed(h.Left) {
-		h = rotateLeft(h)
-	}
-
-	if isRed(h.Left) && isRed(h.Left.Left) {
-		h = rotateRight(h)
-	}
-
-	return h
-}
-
-// DeleteMin deletes the minimum element in the tree and returns the
-// deleted item or nil otherwise.
-func (t *LLRB) DeleteMin() Item {
-	var deleted Item
-	t.root, deleted = deleteMin(t.root)
-	if t.root != nil {
-		t.root.Black = true
-	}
-	if deleted != nil {
-		t.count--
-	}
-	return deleted
-}
-
-// deleteMin code for LLRB 2-3 trees
-func deleteMin(h *Node) (*Node, Item) {
-	if h == nil {
-		return nil, nil
-	}
-	if h.Left == nil {
-		return nil, h.Item
-	}
-
-	if !isRed(h.Left) && !isRed(h.Left.Left) {
-		h = moveRedLeft(h)
-	}
-
-	var deleted Item
-	h.Left, deleted = deleteMin(h.Left)
-
-	return fixUp(h), deleted
-}
-
-// DeleteMax deletes the maximum element in the tree and returns
-// the deleted item or nil otherwise
-func (t *LLRB) DeleteMax() Item {
-	var deleted Item
-	t.root, deleted = deleteMax(t.root)
-	if t.root != nil {
-		t.root.Black = true
-	}
-	if deleted != nil {
-		t.count--
-	}
-	return deleted
-}
-
-func deleteMax(h *Node) (*Node, Item) {
-	if h == nil {
-		return nil, nil
-	}
-	if isRed(h.Left) {
-		h = rotateRight(h)
-	}
-	if h.Right == nil {
-		return nil, h.Item
-	}
-	if !isRed(h.Right) && !isRed(h.Right.Left) {
-		h = moveRedRight(h)
-	}
-	var deleted Item
-	h.Right, deleted = deleteMax(h.Right)
-
-	return fixUp(h), deleted
-}
-
-// Delete deletes an item from the tree whose key equals key.
-// The deleted item is return, otherwise nil is returned.
-func (t *LLRB) Delete(key Item) Item {
-	var deleted Item
-	t.root, deleted = t.delete(t.root, key)
-	if t.root != nil {
-		t.root.Black = true
-	}
-	if deleted != nil {
-		t.count--
-	}
-	return deleted
-}
-
-func (t *LLRB) delete(h *Node, item Item) (*Node, Item) {
-	var deleted Item
-	if h == nil {
-		return nil, nil
-	}
-	if less(item, h.Item) {
-		if h.Left == nil { // item not present. Nothing to delete
-			return h, nil
-		}
-		if !isRed(h.Left) && !isRed(h.Left.Left) {
-			h = moveRedLeft(h)
-		}
-		h.Left, deleted = t.delete(h.Left, item)
-	} else {
-		if isRed(h.Left) {
-			h = rotateRight(h)
-		}
-		// If @item equals @h.Item and no right children at @h
-		if !less(h.Item, item) && h.Right == nil {
-			return nil, h.Item
-		}
-		// PETAR: Added 'h.Right != nil' below
-		if h.Right != nil && !isRed(h.Right) && !isRed(h.Right.Left) {
-			h = moveRedRight(h)
-		}
-		// If @item equals @h.Item, and (from above) 'h.Right != nil'
-		if !less(h.Item, item) {
-			var subDeleted Item
-			h.Right, subDeleted = deleteMin(h.Right)
-			if subDeleted == nil {
-				panic("logic")
-			}
-			deleted, h.Item = h.Item, subDeleted
-		} else { // Else, @item is bigger than @h.Item
-			h.Right, deleted = t.delete(h.Right, item)
-		}
-	}
-
-	return fixUp(h), deleted
-}
-
-// Internal node manipulation routines
-
-func newNode(item Item) *Node { return &Node{Item: item} }
-
-func isRed(h *Node) bool {
-	if h == nil {
-		return false
-	}
-	return !h.Black
-}
-
-func rotateLeft(h *Node) *Node {
-	x := h.Right
-	if x.Black {
-		panic("rotating a black link")
-	}
-	h.Right = x.Left
-	x.Left = h
-	x.Black = h.Black
-	h.Black = false
-	return x
-}
-
-func rotateRight(h *Node) *Node {
-	x := h.Left
-	if x.Black {
-		panic("rotating a black link")
-	}
-	h.Left = x.Right
-	x.Right = h
-	x.Black = h.Black
-	h.Black = false
-	return x
-}
-
-// REQUIRE: Left and Right children must be present
-func flip(h *Node) {
-	h.Black = !h.Black
-	h.Left.Black = !h.Left.Black
-	h.Right.Black = !h.Right.Black
-}
-
-// REQUIRE: Left and Right children must be present
-func moveRedLeft(h *Node) *Node {
-	flip(h)
-	if isRed(h.Right.Left) {
-		h.Right = rotateRight(h.Right)
-		h = rotateLeft(h)
-		flip(h)
-	}
-	return h
-}
-
-// REQUIRE: Left and Right children must be present
-func moveRedRight(h *Node) *Node {
-	flip(h)
-	if isRed(h.Left.Left) {
-		h = rotateRight(h)
-		flip(h)
-	}
-	return h
-}
-
-func fixUp(h *Node) *Node {
-	if isRed(h.Right) {
-		h = rotateLeft(h)
-	}
-
-	if isRed(h.Left) && isRed(h.Left.Left) {
-		h = rotateRight(h)
-	}
-
-	if isRed(h.Left) && isRed(h.Right) {
-		flip(h)
-	}
-
-	return h
-}
diff --git a/vendor/github.com/petar/GoLLRB/llrb/util.go b/vendor/github.com/petar/GoLLRB/llrb/util.go
deleted file mode 100644
index 63dbdb2..0000000
--- a/vendor/github.com/petar/GoLLRB/llrb/util.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2010 Petar Maymounkov. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package llrb
-
-type Int int
-
-func (x Int) Less(than Item) bool {
-	return x < than.(Int)
-}
-
-type String string
-
-func (x String) Less(than Item) bool {
-	return x < than.(String)
-}
diff --git a/vendor/github.com/pierrec/lz4/.travis.yml b/vendor/github.com/pierrec/lz4/.travis.yml
index 658910d..b2c806d 100644
--- a/vendor/github.com/pierrec/lz4/.travis.yml
+++ b/vendor/github.com/pierrec/lz4/.travis.yml
@@ -1,13 +1,9 @@
 language: go
 
-env:
-  - GO111MODULE=off
-  - GO111MODULE=on
-
 go:
+  - 1.8.x
   - 1.9.x
   - 1.10.x
-  - 1.11.x
   - master
 
 matrix:
@@ -20,5 +16,3 @@
 script: 
  - go test -v -cpu=2
  - go test -v -cpu=2 -race
- - go test -v -cpu=2 -tags noasm
- - go test -v -cpu=2 -race -tags noasm
diff --git a/vendor/github.com/pierrec/lz4/block.go b/vendor/github.com/pierrec/lz4/block.go
index d96e0e7..ef24f17 100644
--- a/vendor/github.com/pierrec/lz4/block.go
+++ b/vendor/github.com/pierrec/lz4/block.go
@@ -30,17 +30,75 @@
 // The destination buffer must be sized appropriately.
 //
 // An error is returned if the source data is invalid or the destination buffer is too small.
-func UncompressBlock(src, dst []byte) (di int, err error) {
+func UncompressBlock(src, dst []byte) (si int, err error) {
+	defer func() {
+		// It is now faster to let the runtime panic and recover on out of bound slice access
+		// than checking indices as we go along.
+		if recover() != nil {
+			err = ErrInvalidSourceShortBuffer
+		}
+	}()
 	sn := len(src)
 	if sn == 0 {
 		return 0, nil
 	}
+	var di int
 
-	di = decodeBlock(dst, src)
-	if di < 0 {
-		return 0, ErrInvalidSourceShortBuffer
+	for {
+		// Literals and match lengths (token).
+		b := int(src[si])
+		si++
+
+		// Literals.
+		if lLen := b >> 4; lLen > 0 {
+			if lLen == 0xF {
+				for src[si] == 0xFF {
+					lLen += 0xFF
+					si++
+				}
+				lLen += int(src[si])
+				si++
+			}
+			i := si
+			si += lLen
+			di += copy(dst[di:], src[i:si])
+
+			if si >= sn {
+				return di, nil
+			}
+		}
+
+		si++
+		_ = src[si] // Bound check elimination.
+		offset := int(src[si-1]) | int(src[si])<<8
+		si++
+
+		// Match.
+		mLen := b & 0xF
+		if mLen == 0xF {
+			for src[si] == 0xFF {
+				mLen += 0xFF
+				si++
+			}
+			mLen += int(src[si])
+			si++
+		}
+		mLen += minMatch
+
+		// Copy the match.
+		i := di - offset
+		if offset > 0 && mLen >= offset {
+			// Efficiently copy the match dst[di-offset:di] into the dst slice.
+			bytesToCopy := offset * (mLen / offset)
+			expanded := dst[i:]
+			for n := offset; n <= bytesToCopy+offset; n *= 2 {
+				copy(expanded[n:], expanded[:n])
+			}
+			di += bytesToCopy
+			mLen -= bytesToCopy
+		}
+		di += copy(dst[di:], dst[i:i+mLen])
 	}
-	return di, nil
 }
 
 // CompressBlock compresses the source buffer into the destination one.
@@ -128,7 +186,7 @@
 		di++
 
 		// Literals.
-		copy(dst[di:di+lLen], src[anchor:anchor+lLen])
+		copy(dst[di:], src[anchor:anchor+lLen])
 		di += lLen + 2
 		anchor = si
 
@@ -172,7 +230,7 @@
 		// Incompressible.
 		return 0, nil
 	}
-	di += copy(dst[di:di+len(src)-anchor], src[anchor:])
+	di += copy(dst[di:], src[anchor:])
 	return di, nil
 }
 
@@ -228,7 +286,7 @@
 			for ml < sn-si && src[next+ml] == src[si+ml] {
 				ml++
 			}
-			if ml < minMatch || ml <= mLen {
+			if ml+1 < minMatch || ml <= mLen {
 				// Match too small (<minMath) or smaller than the current match.
 				continue
 			}
@@ -289,7 +347,7 @@
 		di++
 
 		// Literals.
-		copy(dst[di:di+lLen], src[anchor:anchor+lLen])
+		copy(dst[di:], src[anchor:anchor+lLen])
 		di += lLen
 		anchor = si
 
@@ -334,6 +392,6 @@
 		// Incompressible.
 		return 0, nil
 	}
-	di += copy(dst[di:di+len(src)-anchor], src[anchor:])
+	di += copy(dst[di:], src[anchor:])
 	return di, nil
 }
diff --git a/vendor/github.com/pierrec/lz4/decode_amd64.go b/vendor/github.com/pierrec/lz4/decode_amd64.go
deleted file mode 100644
index 43cc14f..0000000
--- a/vendor/github.com/pierrec/lz4/decode_amd64.go
+++ /dev/null
@@ -1,8 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !noasm
-
-package lz4
-
-//go:noescape
-func decodeBlock(dst, src []byte) int
diff --git a/vendor/github.com/pierrec/lz4/decode_amd64.s b/vendor/github.com/pierrec/lz4/decode_amd64.s
deleted file mode 100644
index 20fef39..0000000
--- a/vendor/github.com/pierrec/lz4/decode_amd64.s
+++ /dev/null
@@ -1,375 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !noasm
-
-#include "textflag.h"
-
-// AX scratch
-// BX scratch
-// CX scratch
-// DX token
-//
-// DI &dst
-// SI &src
-// R8 &dst + len(dst)
-// R9 &src + len(src)
-// R11 &dst
-// R12 short output end
-// R13 short input end
-// func decodeBlock(dst, src []byte) int
-// using 50 bytes of stack currently
-TEXT ·decodeBlock(SB), NOSPLIT, $64-56
-	MOVQ dst_base+0(FP), DI
-	MOVQ DI, R11
-	MOVQ dst_len+8(FP), R8
-	ADDQ DI, R8
-
-	MOVQ src_base+24(FP), SI
-	MOVQ src_len+32(FP), R9
-	ADDQ SI, R9
-
-	// shortcut ends
-	// short output end
-	MOVQ R8, R12
-	SUBQ $32, R12
-	// short input end
-	MOVQ R9, R13
-	SUBQ $16, R13
-
-loop:
-	// for si < len(src)
-	CMPQ SI, R9
-	JGE end
-
-	// token := uint32(src[si])
-	MOVBQZX (SI), DX
-	INCQ SI
-
-	// lit_len = token >> 4
-	// if lit_len > 0
-	// CX = lit_len
-	MOVQ DX, CX
-	SHRQ $4, CX
-
-	// if lit_len != 0xF
-	CMPQ CX, $0xF
-	JEQ lit_len_loop_pre
-	CMPQ DI, R12
-	JGE lit_len_loop_pre
-	CMPQ SI, R13
-	JGE lit_len_loop_pre
-
-	// copy shortcut
-
-	// A two-stage shortcut for the most common case:
-	// 1) If the literal length is 0..14, and there is enough space,
-	// enter the shortcut and copy 16 bytes on behalf of the literals
-	// (in the fast mode, only 8 bytes can be safely copied this way).
-	// 2) Further if the match length is 4..18, copy 18 bytes in a similar
-	// manner; but we ensure that there's enough space in the output for
-	// those 18 bytes earlier, upon entering the shortcut (in other words,
-	// there is a combined check for both stages).
-
-	// copy literal
-	MOVOU (SI), X0
-	MOVOU X0, (DI)
-	ADDQ CX, DI
-	ADDQ CX, SI
-
-	MOVQ DX, CX
-	ANDQ $0xF, CX
-
-	// The second stage: prepare for match copying, decode full info.
-	// If it doesn't work out, the info won't be wasted.
-	// offset := uint16(data[:2])
-	MOVWQZX (SI), DX
-	ADDQ $2, SI
-
-	MOVQ DI, AX
-	SUBQ DX, AX
-	CMPQ AX, DI
-	JGT err_short_buf
-
-	// if we can't do the second stage then jump straight to read the
-	// match length, we already have the offset.
-	CMPQ CX, $0xF
-	JEQ match_len_loop_pre
-	CMPQ DX, $8
-	JLT match_len_loop_pre
-	CMPQ AX, R11
-	JLT err_short_buf
-
-	// memcpy(op + 0, match + 0, 8);
-	MOVQ (AX), BX
-	MOVQ BX, (DI)
-	// memcpy(op + 8, match + 8, 8);
-	MOVQ 8(AX), BX
-	MOVQ BX, 8(DI)
-	// memcpy(op +16, match +16, 2);
-	MOVW 16(AX), BX
-	MOVW BX, 16(DI)
-
-	ADDQ $4, DI // minmatch
-	ADDQ CX, DI
-
-	// shortcut complete, load next token
-	JMP loop
-
-lit_len_loop_pre:
-	// if lit_len > 0
-	CMPQ CX, $0
-	JEQ offset
-	CMPQ CX, $0xF
-	JNE copy_literal
-
-lit_len_loop:
-	// for src[si] == 0xFF
-	CMPB (SI), $0xFF
-	JNE lit_len_finalise
-
-	// bounds check src[si+1]
-	MOVQ SI, AX
-	ADDQ $1, AX
-	CMPQ AX, R9
-	JGT err_short_buf
-
-	// lit_len += 0xFF
-	ADDQ $0xFF, CX
-	INCQ SI
-	JMP lit_len_loop
-
-lit_len_finalise:
-	// lit_len += int(src[si])
-	// si++
-	MOVBQZX (SI), AX
-	ADDQ AX, CX
-	INCQ SI
-
-copy_literal:
-	// bounds check src and dst
-	MOVQ SI, AX
-	ADDQ CX, AX
-	CMPQ AX, R9
-	JGT err_short_buf
-
-	MOVQ DI, AX
-	ADDQ CX, AX
-	CMPQ AX, R8
-	JGT err_short_buf
-
-	// whats a good cut off to call memmove?
-	CMPQ CX, $16
-	JGT memmove_lit
-
-	// if len(dst[di:]) < 16
-	MOVQ R8, AX
-	SUBQ DI, AX
-	CMPQ AX, $16
-	JLT memmove_lit
-
-	// if len(src[si:]) < 16
-	MOVQ R9, AX
-	SUBQ SI, AX
-	CMPQ AX, $16
-	JLT memmove_lit
-
-	MOVOU (SI), X0
-	MOVOU X0, (DI)
-
-	JMP finish_lit_copy
-
-memmove_lit:
-	// memmove(to, from, len)
-	MOVQ DI, 0(SP)
-	MOVQ SI, 8(SP)
-	MOVQ CX, 16(SP)
-	// spill
-	MOVQ DI, 24(SP)
-	MOVQ SI, 32(SP)
-	MOVQ CX, 40(SP) // need len to inc SI, DI after
-	MOVB DX, 48(SP)
-	CALL runtime·memmove(SB)
-
-	// restore registers
-	MOVQ 24(SP), DI
-	MOVQ 32(SP), SI
-	MOVQ 40(SP), CX
-	MOVB 48(SP), DX
-
-	// recalc initial values
-	MOVQ dst_base+0(FP), R8
-	MOVQ R8, R11
-	ADDQ dst_len+8(FP), R8
-	MOVQ src_base+24(FP), R9
-	ADDQ src_len+32(FP), R9
-	MOVQ R8, R12
-	SUBQ $32, R12
-	MOVQ R9, R13
-	SUBQ $16, R13
-
-finish_lit_copy:
-	ADDQ CX, SI
-	ADDQ CX, DI
-
-	CMPQ SI, R9
-	JGE end
-
-offset:
-	// CX := mLen
-	// free up DX to use for offset
-	MOVQ DX, CX
-
-	MOVQ SI, AX
-	ADDQ $2, AX
-	CMPQ AX, R9
-	JGT err_short_buf
-
-	// offset
-	// DX := int(src[si]) | int(src[si+1])<<8
-	MOVWQZX (SI), DX
-	ADDQ $2, SI
-
-	// 0 offset is invalid
-	CMPQ DX, $0
-	JEQ err_corrupt
-
-	ANDB $0xF, CX
-
-match_len_loop_pre:
-	// if mlen != 0xF
-	CMPB CX, $0xF
-	JNE copy_match
-
-match_len_loop:
-	// for src[si] == 0xFF
-	// lit_len += 0xFF
-	CMPB (SI), $0xFF
-	JNE match_len_finalise
-
-	// bounds check src[si+1]
-	MOVQ SI, AX
-	ADDQ $1, AX
-	CMPQ AX, R9
-	JGT err_short_buf
-
-	ADDQ $0xFF, CX
-	INCQ SI
-	JMP match_len_loop
-
-match_len_finalise:
-	// lit_len += int(src[si])
-	// si++
-	MOVBQZX (SI), AX
-	ADDQ AX, CX
-	INCQ SI
-
-copy_match:
-	// mLen += minMatch
-	ADDQ $4, CX
-
-	// check we have match_len bytes left in dst
-	// di+match_len < len(dst)
-	MOVQ DI, AX
-	ADDQ CX, AX
-	CMPQ AX, R8
-	JGT err_short_buf
-
-	// DX = offset
-	// CX = match_len
-	// BX = &dst + (di - offset)
-	MOVQ DI, BX
-	SUBQ DX, BX
-
-	// check BX is within dst
-	// if BX < &dst
-	CMPQ BX, R11
-	JLT err_short_buf
-
-	// if offset + match_len < di
-	MOVQ BX, AX
-	ADDQ CX, AX
-	CMPQ DI, AX
-	JGT copy_interior_match
-
-	// AX := len(dst[:di])
-	// MOVQ DI, AX
-	// SUBQ R11, AX
-
-	// copy 16 bytes at a time
-	// if di-offset < 16 copy 16-(di-offset) bytes to di
-	// then do the remaining
-
-copy_match_loop:
-	// for match_len >= 0
-	// dst[di] = dst[i]
-	// di++
-	// i++
-	MOVB (BX), AX
-	MOVB AX, (DI)
-	INCQ DI
-	INCQ BX
-	DECQ CX
-
-	CMPQ CX, $0
-	JGT copy_match_loop
-
-	JMP loop
-
-copy_interior_match:
-	CMPQ CX, $16
-	JGT memmove_match
-
-	// if len(dst[di:]) < 16
-	MOVQ R8, AX
-	SUBQ DI, AX
-	CMPQ AX, $16
-	JLT memmove_match
-
-	MOVOU (BX), X0
-	MOVOU X0, (DI)
-
-	ADDQ CX, DI
-	JMP loop
-
-memmove_match:
-	// memmove(to, from, len)
-	MOVQ DI, 0(SP)
-	MOVQ BX, 8(SP)
-	MOVQ CX, 16(SP)
-	// spill
-	MOVQ DI, 24(SP)
-	MOVQ SI, 32(SP)
-	MOVQ CX, 40(SP) // need len to inc SI, DI after
-	CALL runtime·memmove(SB)
-
-	// restore registers
-	MOVQ 24(SP), DI
-	MOVQ 32(SP), SI
-	MOVQ 40(SP), CX
-
-	// recalc initial values
-	MOVQ dst_base+0(FP), R8
-	MOVQ R8, R11 // TODO: make these sensible numbers
-	ADDQ dst_len+8(FP), R8
-	MOVQ src_base+24(FP), R9
-	ADDQ src_len+32(FP), R9
-	MOVQ R8, R12
-	SUBQ $32, R12
-	MOVQ R9, R13
-	SUBQ $16, R13
-
-	ADDQ CX, DI
-	JMP loop
-
-err_corrupt:
-	MOVQ $-1, ret+48(FP)
-	RET
-
-err_short_buf:
-	MOVQ $-2, ret+48(FP)
-	RET
-
-end:
-	SUBQ R11, DI
-	MOVQ DI, ret+48(FP)
-	RET
diff --git a/vendor/github.com/pierrec/lz4/decode_other.go b/vendor/github.com/pierrec/lz4/decode_other.go
deleted file mode 100644
index b83a19a..0000000
--- a/vendor/github.com/pierrec/lz4/decode_other.go
+++ /dev/null
@@ -1,95 +0,0 @@
-// +build !amd64 appengine !gc noasm
-
-package lz4
-
-func decodeBlock(dst, src []byte) (ret int) {
-	defer func() {
-		// It is now faster to let the runtime panic and recover on out of bound slice access
-		// than checking indices as we go along.
-		if recover() != nil {
-			ret = -2
-		}
-	}()
-
-	var si, di int
-	for {
-		// Literals and match lengths (token).
-		b := int(src[si])
-		si++
-
-		// Literals.
-		if lLen := b >> 4; lLen > 0 {
-			switch {
-			case lLen < 0xF && di+18 < len(dst) && si+16 < len(src):
-				// Shortcut 1
-				// if we have enough room in src and dst, and the literals length
-				// is small enough (0..14) then copy all 16 bytes, even if not all
-				// are part of the literals.
-				copy(dst[di:], src[si:si+16])
-				si += lLen
-				di += lLen
-				if mLen := b & 0xF; mLen < 0xF {
-					// Shortcut 2
-					// if the match length (4..18) fits within the literals, then copy
-					// all 18 bytes, even if not all are part of the literals.
-					mLen += 4
-					if offset := int(src[si]) | int(src[si+1])<<8; mLen <= offset {
-						i := di - offset
-						copy(dst[di:], dst[i:i+18])
-						si += 2
-						di += mLen
-						continue
-					}
-				}
-			case lLen == 0xF:
-				for src[si] == 0xFF {
-					lLen += 0xFF
-					si++
-				}
-				lLen += int(src[si])
-				si++
-				fallthrough
-			default:
-				copy(dst[di:di+lLen], src[si:si+lLen])
-				si += lLen
-				di += lLen
-			}
-		}
-		if si >= len(src) {
-			return di
-		}
-
-		offset := int(src[si]) | int(src[si+1])<<8
-		if offset == 0 {
-			return -2
-		}
-		si += 2
-
-		// Match.
-		mLen := b & 0xF
-		if mLen == 0xF {
-			for src[si] == 0xFF {
-				mLen += 0xFF
-				si++
-			}
-			mLen += int(src[si])
-			si++
-		}
-		mLen += minMatch
-
-		// Copy the match.
-		expanded := dst[di-offset:]
-		if mLen > offset {
-			// Efficiently copy the match dst[di-offset:di] into the dst slice.
-			bytesToCopy := offset * (mLen / offset)
-			for n := offset; n <= bytesToCopy+offset; n *= 2 {
-				copy(expanded[n:], expanded[:n])
-			}
-			di += bytesToCopy
-			mLen -= bytesToCopy
-		}
-		di += copy(dst[di:di+mLen], expanded[:mLen])
-	}
-
-	return di
-}
diff --git a/vendor/github.com/pierrec/lz4/go.mod b/vendor/github.com/pierrec/lz4/go.mod
deleted file mode 100644
index f9f570a..0000000
--- a/vendor/github.com/pierrec/lz4/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module github.com/pierrec/lz4
-
-require github.com/pkg/profile v1.2.1
diff --git a/vendor/github.com/pierrec/lz4/go.sum b/vendor/github.com/pierrec/lz4/go.sum
deleted file mode 100644
index 6ca7598..0000000
--- a/vendor/github.com/pierrec/lz4/go.sum
+++ /dev/null
@@ -1,2 +0,0 @@
-github.com/pkg/profile v1.2.1 h1:F++O52m40owAmADcojzM+9gyjmMOY/T4oYJkgFDH8RE=
-github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
diff --git a/vendor/github.com/rcrowley/go-metrics/validate.sh b/vendor/github.com/rcrowley/go-metrics/validate.sh
old mode 100755
new mode 100644
