// CmdGetMapped returns the interface settings in a map
176747
func (e *Ethtool) CmdGetMapped(intf string) (map[string]uint64, error) {
	ecmd := EthtoolCmd{
		Cmd: ETHTOOL_GSET,
	}

	var name [IFNAMSIZ]byte
	copy(name[:], []byte(intf))

	ifr := ifreq{
		ifr_name: name,
		ifr_data: uintptr(unsafe.Pointer(&ecmd)),
	}

	_, _, ep := syscall.Syscall(syscall.SYS_IOCTL, uintptr(e.fd),
		SIOCETHTOOL, uintptr(unsafe.Pointer(&ifr)))
	if ep != 0 {
		return nil, syscall.Errno(ep)
	}

	var result = make(map[string]uint64)

	// ref https://gist.github.com/drewolson/4771479
	// Golang Reflection Example
	ecmd.reflect(&result)

	var speedval uint32 = (uint32(ecmd.Speed_hi) << 16) |
		(uint32(ecmd.Speed) & 0xffff)
	result["speed"] = uint64(speedval)

	return result, nil
}
157220
func (f *File) SetMapFlat(values map[string]string) {
	for key, value := range values {
		f.SetKey(key, value)
	}
}
590953
func (s *cScreen) mapStyle(style Style) uint16 {
	f, b, a := style.Decompose()
	fa := s.oscreen.attrs & 0xf
	ba := (s.oscreen.attrs) >> 4 & 0xf
	if f != ColorDefault {
		fa = mapColor2RGB(f)
	}
	if b != ColorDefault {
		ba = mapColor2RGB(b)
	}
	var attr uint16
	// We simulate reverse by doing the color swap ourselves.
	// Apparently windows cannot really do this except in DBCS
	// views.
	if a&AttrReverse != 0 {
		attr = ba
		attr |= (fa << 4)
	} else {
		attr = fa
		attr |= (ba << 4)
	}
	if a&AttrBold != 0 {
		attr |= 0x8
	}
	if a&AttrDim != 0 {
		attr &^= 0x8
	}
	if a&AttrUnderline != 0 {
		// Best effort -- doesn't seem to work though.
		attr |= 0x8000
	}
	// Blink is unsupported
	return attr
}
516647
func (s *LabelService) CreateLabelMapping(ctx context.Context, m *platform.LabelMapping) error {
	return s.CreateLabelMappingFn(ctx, m)
}
429320
func SetNestedMap(obj map[string]interface{}, value map[string]interface{}, fields ...string) error {
	return SetNestedField(obj, value, fields...)
}
1313408
func setUsesMap(spec *compile.SetSpec) bool {
	return (spec.Annotations[goTypeKey] != sliceType) && isHashable(spec.ValueSpec)
}
569935
func (s *UpdateFunctionInput) SetResponseMappingTemplate(v string) *UpdateFunctionInput {
	s.ResponseMappingTemplate = &v
	return s
}
474473
func NewKeymap(config map[string]string, actions map[string][]string) Keymap {
	return Keymap{
		Config: config,
		Action: actions,
		seq:    keyseq.New(),
	}
}
138013
func (eg *EngineGroup) SetTableMapper(mapper core.IMapper) {
	eg.Engine.TableMapper = mapper
	for i := 0; i < len(eg.slaves); i++ {
		eg.slaves[i].TableMapper = mapper
	}
}
282442
func MapToCFDictionary(m map[C.CFTypeRef]C.CFTypeRef) (C.CFDictionaryRef, error) {
	var keys, values []unsafe.Pointer
	for key, value := range m {
		keys = append(keys, unsafe.Pointer(key))
		values = append(values, unsafe.Pointer(value))
	}
	numValues := len(values)
	var keysPointer, valuesPointer *unsafe.Pointer
	if numValues > 0 {
		keysPointer = &keys[0]
		valuesPointer = &values[0]
	}
	cfDict := C.CFDictionaryCreate(nil, keysPointer, valuesPointer, C.CFIndex(numValues), &C.kCFTypeDictionaryKeyCallBacks, &C.kCFTypeDictionaryValueCallBacks)
	if cfDict == nil {
		return nil, fmt.Errorf("CFDictionaryCreate failed")
	}
	return cfDict, nil
}
835983
func RemoveDisabledMaps() {
	maps := []string{}

	if !option.Config.EnableIPv6 {
		maps = append(maps, []string{
			"cilium_ct6_global",
			"cilium_ct_any6_global",
			"cilium_lb6_reverse_nat",
			"cilium_lb6_rr_seq",
			"cilium_lb6_services",
			"cilium_snat_v6_external",
			"cilium_proxy6"}...)
	}

	if !option.Config.EnableIPv4 {
		maps = append(maps, []string{
			"cilium_ct4_global",
			"cilium_ct_any4_global",
			"cilium_lb4_reverse_nat",
			"cilium_lb4_rr_seq",
			"cilium_lb4_services",
			"cilium_snat_v4_external",
			"cilium_proxy4"}...)
	}

	for _, m := range maps {
		p := path.Join(bpf.MapPrefixPath(), m)
		if _, err := os.Stat(p); !os.IsNotExist(err) {
			globalSweeper.removeMapPath(p)
		}
	}
}
983651
func Map(ui cli.Ui) map[string]cli.CommandFactory {
	m := make(map[string]cli.CommandFactory)
	for name, fn := range registry {
		thisFn := fn
		m[name] = func() (cli.Command, error) {
			return thisFn(ui)
		}
	}
	return m
}
30564
func (s *FunctionConfiguration) SetResponseMappingTemplate(v string) *FunctionConfiguration {
	s.ResponseMappingTemplate = &v
	return s
}
75434
func PackMap(cmd BufferEx, theMap MapIter) (int, error) {
	return packMap(cmd, theMap)
}
356835
func (c ItemChanges) Map() (map[string]ItemChange, error) {
	m := make(map[string]ItemChange, len(c))
	for _, ch := range c {
		k := ch.Key
		if _, ok := m[k]; ok {
			return nil, errors.Errorf("duplicated key in settings collection: %q", k)
		}
		m[k] = ch
	}
	return m, nil
}
1279338
func OptionPortMapping(portBindings []types.PortBinding) SandboxOption {
	return func(sb *sandbox) {
		if sb.config.generic == nil {
			sb.config.generic = make(map[string]interface{})
		}
		// Store a copy of the bindings as generic data to pass to the driver
		pbs := make([]types.PortBinding, len(portBindings))
		copy(pbs, portBindings)
		sb.config.generic[netlabel.PortMap] = pbs
	}
}
169848
func (s *RemixSettings) SetChannelMapping(v *ChannelMapping) *RemixSettings {
	s.ChannelMapping = v
	return s
}