summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/buffer/prependable.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-10-22 18:59:52 +0000
committergVisor bot <gvisor-bot@google.com>2019-10-22 18:59:52 +0000
commit4bf4cd0e7a8be72bf467f7d580d0fd3242b3a645 (patch)
treed33823e595a186be5bf1cfd02d0e14b9cbba73d8 /pkg/tcpip/buffer/prependable.go
parent1e55a0ef32ae01e56ec07c660468039d2ab4288b (diff)
parent8720bd643ef37a693984baba83c37458f6691df1 (diff)
Merge release-20190806.1-300-g8720bd6 (automated)
Diffstat (limited to 'pkg/tcpip/buffer/prependable.go')
-rw-r--r--pkg/tcpip/buffer/prependable.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/tcpip/buffer/prependable.go b/pkg/tcpip/buffer/prependable.go
index 4287464f3..48a2a2713 100644
--- a/pkg/tcpip/buffer/prependable.go
+++ b/pkg/tcpip/buffer/prependable.go
@@ -41,6 +41,11 @@ func NewPrependableFromView(v View) Prependable {
return Prependable{buf: v, usedIdx: 0}
}
+// NewEmptyPrependableFromView creates a new prependable buffer from a View.
+func NewEmptyPrependableFromView(v View) Prependable {
+ return Prependable{buf: v, usedIdx: len(v)}
+}
+
// View returns a View of the backing buffer that contains all prepended
// data so far.
func (p Prependable) View() View {