VOL-2017 voltha-lib moved from voltha-go;
release version 2.2.1
Based on voltha-go commit 5259f8e52b3e3f5c7ad422a4b0e506e1d07f6b36
Change-Id: I8bbecdf456e420714a4016120eafc0d237c80565
diff --git a/vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go b/vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go
new file mode 100644
index 0000000..5fd27da
--- /dev/null
+++ b/vendor/gopkg.in/jcmturner/rpc.v1/ndr/pipe.go
@@ -0,0 +1,31 @@
+package ndr
+
+import (
+ "fmt"
+ "reflect"
+)
+
+func (dec *Decoder) fillPipe(v reflect.Value, tag reflect.StructTag) error {
+ s, err := dec.readUint32() // read element count of first chunk
+ if err != nil {
+ return err
+ }
+ a := reflect.MakeSlice(v.Type(), 0, 0)
+ c := reflect.MakeSlice(v.Type(), int(s), int(s))
+ for s != 0 {
+ for i := 0; i < int(s); i++ {
+ err := dec.fill(c.Index(i), tag, &[]deferedPtr{})
+ if err != nil {
+ return fmt.Errorf("could not fill element %d of pipe: %v", i, err)
+ }
+ }
+ s, err = dec.readUint32() // read element count of first chunk
+ if err != nil {
+ return err
+ }
+ a = reflect.AppendSlice(a, c)
+ c = reflect.MakeSlice(v.Type(), int(s), int(s))
+ }
+ v.Set(a)
+ return nil
+}