You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: multipart.go
    path of file: ./repos/sliver/vendor/golang.org/x/net/icmp
    
    the code of the file until where you have to start completion: // Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package icmp

import "golang.org/x/net/internal/iana"

// multipartMessageBodyDataLen takes b as an original datagram and
// exts as extensions, and returns a required length for message body
// and a required length for a padded original datagram in wire
// format.
func multipartMessageBodyDataLen(proto int, withOrigDgram bool, b []byte, exts []Extension) (bodyLen, dataLen int) {
	bodyLen = 4 // length of leading octets
	var extLen int
	var rawExt bool // raw extension may contain an empty object
	for _, ext := range exts {
		extLen += ext.Len(proto)
		if _, ok := ext.(*RawExtension); ok {
			rawExt = true
		}
	}
	if extLen > 0 && withOrigDgram {
		dataLen = multipartMessageOrigDatagramLe
    
func marshalMultipartMessageBody(proto int, withOrigDgram bool, data []byte, exts []Extension) ([]byte, error) {
	bodyLen, dataLen := multipartMessageBodyDataLen(proto, withOrigDgram, data, exts)
	b := make([]byte, bodyLen)
	copy(b[4:], data)
	if len(exts) > 0 {
		b[4+dataLen] = byte(extensionVersion << 4)
		off := 4 + dataLen + 4 // leading octets, data, extension header
		for _, ext := range exts {
			switch ext := ext.(type) {
			case *MPLSLabelStack:
				if err := ext.marshal(proto, b[off:]); err != nil {
					return nil, err
				}
				off += ext.Len(proto)
			case *InterfaceInfo:
				attrs, l := ext.attrsAndLen(proto)
				if err := ext.marshal(proto, b[off:], attrs, l); err != nil {
					return nil, err
				}
				off += ext.Len(proto)
			case *InterfaceIdent:
				if err := ext.marshal(proto, b[off:]); err != nil {
					return nil, err
				}
				off += ext.Len(proto)
			case *RawExtension:
				copy(b[off:], ext.Data)
				off += ext.Len(proto)
			}
		}
		s := checksum(b[4+dataLen:])
		b[4+dataLen+2] ^= byte(s)
		b[4+dataLen+3] ^= byte(s >> 8)
		if withOrigDgram {
			switch proto {
			case iana.ProtocolICMP:
				b[1] = byte(dataLen / 4)
			case iana.ProtocolIPv6ICMP:
				b[0] = byte(dataLen / 8)
			}
		}
	}
	return b, nil
}