func (c *dgramOpt) SetChecksum(on bool, offset int) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoChecksum]
	if !ok {
		return errNotImplemented
	}
	if !on {
		offset = -1
	}
	return so.SetInt(c.Conn, offset)
}
SetChecksum enables the kernel checksum processing. If on is ture,
the offset should be an offset in bytes into the data of where the
checksum field is located.
package ipv6
import (
	"net"
	"golang.org/x/net/bpf"
)
func (c *dgramOpt) MulticastHopLimit() (int, error) {
	if !c.ok() {
		return 0, errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastHopLimit]
	if !ok {
		return 0, errNotImplemented
	}
	return so.GetInt(c.Conn)
}
func (c *dgramOpt) SetMulticastHopLimit(hoplim int) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastHopLimit]
	if !ok {
		return errNotImplemented
	}
	return so.SetInt(c.Conn, hoplim)
}
func (c *dgramOpt) MulticastInterface() (*net.Interface, error) {
	if !c.ok() {
		return nil, errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastInterface]
	if !ok {
		return nil, errNotImplemented
	}
	return so.getMulticastInterface(c.Conn)
}
func (c *dgramOpt) SetMulticastInterface(ifi *net.Interface) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastInterface]
	if !ok {
		return errNotImplemented
	}
	return so.setMulticastInterface(c.Conn, ifi)
}
func (c *dgramOpt) MulticastLoopback() (bool, error) {
	if !c.ok() {
		return false, errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastLoopback]
	if !ok {
		return false, errNotImplemented
	}
	on, err := so.GetInt(c.Conn)
	if err != nil {
		return false, err
	}
	return on == 1, nil
}
func (c *dgramOpt) SetMulticastLoopback(on bool) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoMulticastLoopback]
	if !ok {
		return errNotImplemented
	}
	return so.SetInt(c.Conn, boolint(on))
}
func (c *dgramOpt) JoinGroup(ifi *net.Interface, group net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoJoinGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	return so.setGroup(c.Conn, ifi, grp)
}
func (c *dgramOpt) LeaveGroup(ifi *net.Interface, group net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoLeaveGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	return so.setGroup(c.Conn, ifi, grp)
}
func (c *dgramOpt) JoinSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoJoinSourceGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	src := netAddrToIP16(source)
	if src == nil {
		return errMissingAddress
	}
	return so.setSourceGroup(c.Conn, ifi, grp, src)
}
func (c *dgramOpt) LeaveSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoLeaveSourceGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	src := netAddrToIP16(source)
	if src == nil {
		return errMissingAddress
	}
	return so.setSourceGroup(c.Conn, ifi, grp, src)
}
func (c *dgramOpt) ExcludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoBlockSourceGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	src := netAddrToIP16(source)
	if src == nil {
		return errMissingAddress
	}
	return so.setSourceGroup(c.Conn, ifi, grp, src)
}
func (c *dgramOpt) IncludeSourceSpecificGroup(ifi *net.Interface, group, source net.Addr) error {
	if !c.ok() {
		return errInvalidConn
	}
	so, ok := sockOpts[ssoUnblockSourceGroup]
	if !ok {
		return errNotImplemented
	}
	grp := netAddrToIP16(group)
	if grp == nil {
		return errMissingAddress
	}
	src := netAddrToIP16(source)
	if src == nil {
		return errMissingAddress
	}
	return so.setSourceGroup(c.Conn, ifi, grp, src)
}
func (c *dgramOpt) Checksum() (on bool, offset int, err error) {
	if !c.ok() {
		return false, 0, errInvalidConn
	}
	so, ok := sockOpts[ssoChecksum]
	if !ok {
		return false, 0, errNotImplemented
	}
	offset, err = so.GetInt(c.Conn)
	if err != nil {
		return false, 0, err
	}
	if offset < 0 {
		return false, 0, nil
	}
	return true, offset, nil
}