// SetVlan sets the Vlan field's value.
770966
func (s *NewPrivateVirtualInterfaceAllocation) SetVlan(v int64) *NewPrivateVirtualInterfaceAllocation {
	s.Vlan = &v
	return s
}
403309
func (s *RemoteIpDetails) SetIpAddressV4(v string) *RemoteIpDetails {
	s.IpAddressV4 = &v
	return s
}
662219
func (gc *Cfg) FreeVLAN(vlan uint) error {
	tempRm, err := resources.GetStateResourceManager()
	if err != nil {
		return err
	}
	ra := core.ResourceManager(tempRm)

	return ra.DeallocateResourceVal("global", resources.AutoVLANResource, vlan)
}
117006
func importVLANs(c context.Context, configSet config.Set) error {
	vlan := &configPB.VLANs{}
	metadata := &config.Meta{}
	if err := cfgclient.Get(c, cfgclient.AsService, configSet, vlansFilename, textproto.Message(vlan), metadata); err != nil {
		return errors.Annotate(err, "failed to load %s", vlansFilename).Err()
	}
	logging.Infof(c, "Found %s revision %q", vlansFilename, metadata.Revision)

	ctx := &validation.Context{Context: c}
	ctx.SetFile(vlansFilename)
	validateVLANs(ctx, vlan)
	if err := ctx.Finalize(); err != nil {
		return errors.Annotate(err, "invalid config").Err()
	}

	if err := model.EnsureVLANs(c, vlan.Vlan); err != nil {
		return errors.Annotate(err, "failed to ensure VLANs").Err()
	}
	if err := model.EnsureIPs(c, vlan.Vlan); err != nil {
		return errors.Annotate(err, "failed to ensure IP addresses").Err()
	}
	return nil
}
140056
func (s *ServerLaunchConfiguration) SetVpc(v string) *ServerLaunchConfiguration {
	s.Vpc = &v
	return s
}
351500
func (s *DescribeVirtualRouterOutput) SetVirtualRouter(v *VirtualRouterData) *DescribeVirtualRouterOutput {
	s.VirtualRouter = v
	return s
}
962178
func (s *CreateModelInput) SetVpcConfig(v *VpcConfig) *CreateModelInput {
	s.VpcConfig = v
	return s
}
454340
func (s *InputDestination) SetVpc(v *InputDestinationVpc) *InputDestination {
	s.Vpc = v
	return s
}
154909
func (s *CreateHostedZoneInput) SetVPC(v *VPC) *CreateHostedZoneInput {
	s.VPC = v
	return s
}
1293380
func (s *UpdateVirtualRouterOutput) SetVirtualRouter(v *VirtualRouterData) *UpdateVirtualRouterOutput {
	s.VirtualRouter = v
	return s
}
79291
func (s *CreateVirtualRouterOutput) SetVirtualRouter(v *VirtualRouterData) *CreateVirtualRouterOutput {
	s.VirtualRouter = v
	return s
}
427062
func (r *Application) SetNetwork(name string, mode PodNetworkMode) *Application {
	if r.Networks == nil {
		r.EmptyNetworks()
	}

	network := PodNetwork{Name: name, Mode: mode}
	networks := *r.Networks
	networks = append(networks, network)
	r.Networks = &networks
	return r
}
1053591
func (s *GetVPCEConfigurationOutput) SetVpceConfiguration(v *VPCEConfiguration) *GetVPCEConfigurationOutput {
	s.VpceConfiguration = v
	return s
}
1109572
func (c *Client) FilterVlan(scope string, data interface{}) (interface{}, error) {
	return c.AccessFilter("filter_vlan", scope, data)
}
744518
func (s *DeleteVirtualRouterOutput) SetVirtualRouter(v *VirtualRouterData) *DeleteVirtualRouterOutput {
	s.VirtualRouter = v
	return s
}
492435
func (s *UpdateFleetInput) SetVpcConfig(v *VpcConfig) *UpdateFleetInput {
	s.VpcConfig = v
	return s
}
738086
func setAddr4(link *netlink.Vxlan, ipn *net.IPNet) error {
	addrs, err := netlink.AddrList(link, syscall.AF_INET)
	if err != nil {
		return err
	}

	addr := netlink.Addr{IPNet: ipn}
	existing := false
	for _, old := range addrs {
		if old.IPNet.String() == addr.IPNet.String() {
			existing = true
			continue
		}
		if err = netlink.AddrDel(link, &old); err != nil {
			return fmt.Errorf("failed to delete IPv4 addr %s from %s", old.String(), link.Attrs().Name)
		}
	}

	if !existing {
		if err = netlink.AddrAdd(link, &addr); err != nil {
			return fmt.Errorf("failed to add IP address %s to %s: %s", ipn.String(), link.Attrs().Name, err)
		}
	}

	return nil
}