| // Copyright 2017 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. |
| func (hs mmsghdrs) pack(ms []Message, parseFn func([]byte, string) (net.Addr, error), marshalFn func(net.Addr) []byte) error { |
| vs := make([]iovec, len(ms[i].Buffers)) |
| sa = make([]byte, sizeofSockaddrInet6) |
| sa = marshalFn(ms[i].Addr) |
| hs[i].Hdr.pack(vs, ms[i].Buffers, ms[i].OOB, sa) |
| func (hs mmsghdrs) unpack(ms []Message, parseFn func([]byte, string) (net.Addr, error), hint string) error { |
| ms[i].NN = hs[i].Hdr.controllen() |
| ms[i].Flags = hs[i].Hdr.flags() |
| ms[i].Addr, err = parseFn(hs[i].Hdr.name(), hint) |