// With an unsafe.Pointer to the block of C memory NewIp6Hdr returns a filled in Ip6Hdr struct.
With an unsafe.Pointer to the block of C memory NewIp6Hdr returns a filled in Ip6Hdr struct.
// With an unsafe . Pointer to the block of C memory NewIp6Hdr returns a filled in Ip6Hdr struct .
func NewIp6Hdr(p unsafe.Pointer) (*Ip6Hdr, unsafe.Pointer) {
	ip6Hdr := &Ip6Hdr{
		cptr: (*C.struct_ip6_hdr)(p),
		payload: unsafe.Pointer(uintptr(p) + uintptr(40)),
	}
	ip6Hdr.SrcAddr = net.IP(C.GoBytes(unsafe.Pointer(&ip6Hdr.cptr.ip6_src), 16))
	ip6Hdr.DstAddr = net.IP(C.GoBytes(unsafe.Pointer(&ip6Hdr.cptr.ip6_dst), 16))
	u := (*C.struct_ip6_hdrctl)(unsafe.Pointer(&ip6Hdr.cptr.ip6_ctlun))
	ip6Hdr.NextHeader = uint8(u.ip6_un1_nxt)
	ip6Hdr.PayloadLen = uint16(C.ntohs(u.ip6_un1_plen))
	return ip6Hdr, ip6Hdr.payload
}
func NewIp6Hdr ( p unsafe . Pointer ) ( * Ip6Hdr , unsafe . Pointer ) { ip6Hdr := & Ip6Hdr { cptr : ( * C . struct_ip6_hdr ) ( p ) , payload : unsafe . Pointer ( uintptr ( p ) + uintptr ( 40 ) ) , } ip6Hdr . SrcAddr = net . IP ( C . GoBytes ( unsafe . Pointer ( & ip6Hdr . cptr . ip6_src ) , 16 ) ) ip6Hdr . DstAddr = net . IP ( C . GoBytes ( unsafe . Pointer ( & ip6Hdr . cptr . ip6_dst ) , 16 ) ) u := ( * C . struct_ip6_hdrctl ) ( unsafe . Pointer ( & ip6Hdr . cptr . ip6_ctlun ) ) ip6Hdr . NextHeader = uint8 ( u . ip6_un1_nxt ) ip6Hdr . PayloadLen = uint16 ( C . ntohs ( u . ip6_un1_plen ) ) return ip6Hdr , ip6Hdr . payload }
With an unsafe.Pointer to the block of C memory NewIp6Hdr returns a filled in Ip6Hdr struct.
With an unsafe . Pointer to the block of C memory NewIp6Hdr returns a filled in Ip6Hdr struct .
// The fixed header of an IPv6 packet consists of its first 40 octets.