// SetVlan sets the Vlan field's value.
327357
func (s *NewTransitVirtualInterface) SetVlan(v int64) *NewTransitVirtualInterface {
	s.Vlan = &v
	return s
}
1109572
func (c *Client) FilterVlan(scope string, data interface{}) (interface{}, error) {
	return c.AccessFilter("filter_vlan", scope, data)
}
1251594
func (s *Instance) SetNetworking(v *InstanceNetworking) *Instance {
	s.Networking = v
	return s
}
1130442
func (s *GetNetworkOutput) SetNetwork(v *Network) *GetNetworkOutput {
	s.Network = v
	return s
}
185001
func (s *DescribeVirtualNodeOutput) SetVirtualNode(v *VirtualNodeData) *DescribeVirtualNodeOutput {
	s.VirtualNode = v
	return s
}
50820
func (s *DvbNitSettings) SetNetworkName(v string) *DvbNitSettings {
	s.NetworkName = &v
	return s
}
1088615
func (s *CreateServiceInput) SetNetworkConfiguration(v *NetworkConfiguration) *CreateServiceInput {
	s.NetworkConfiguration = 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)
}
20635
func (s *NewPublicVirtualInterface) SetVlan(v int64) *NewPublicVirtualInterface {
	s.Vlan = &v
	return s
}
668573
func (s *UpdateVirtualInterfaceAttributesOutput) SetVlan(v int64) *UpdateVirtualInterfaceAttributesOutput {
	s.Vlan = &v
	return s
}
449728
func (s *CreateVPCAssociationAuthorizationInput) SetVPC(v *VPC) *CreateVPCAssociationAuthorizationInput {
	s.VPC = v
	return s
}
1359128
func (s *AssociateVPCWithHostedZoneInput) SetVPC(v *VPC) *AssociateVPCWithHostedZoneInput {
	s.VPC = 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
}
593508
func (s *CreateInputInput) SetVpc(v *InputVpcRequest) *CreateInputInput {
	s.Vpc = v
	return s
}
44901
func (b *BigIP) ModifyVlan(name string, config *Vlan) error {
	return b.put(config, uriNet, uriVlan, name)
}
1115377
func (s *NetworkInterface) SetIpv4Address(v string) *NetworkInterface {
	s.Ipv4Address = &v
	return s
}
1124561
func (e *Engine) updateVLANs() {
	e.clusterLock.RLock()
	cluster := e.cluster
	e.clusterLock.RUnlock()

	add := make([]*seesaw.VLAN, 0)
	remove := make([]*seesaw.VLAN, 0)

	e.vlanLock.Lock()
	defer e.vlanLock.Unlock()

	for key, vlan := range e.vlans {
		if cluster.VLANs[key] == nil {
			remove = append(remove, vlan)
		} else if !vlan.Equal(cluster.VLANs[key]) {
			// TODO(angusc): This will break any VIPs that are currently configured
			// on the VLAN interface. Fix!
			remove = append(remove, vlan)
			add = append(add, cluster.VLANs[key])
		}
	}
	for key, vlan := range cluster.VLANs {
		if e.vlans[key] == nil {
			add = append(add, vlan)
		}
	}

	if err := e.ncc.Dial(); err != nil {
		log.Fatalf("Failed to connect to NCC: %v", err)
	}
	defer e.ncc.Close()

	for _, vlan := range remove {
		log.Infof("Removing VLAN interface %v", vlan)
		if err := e.lbInterface.DeleteVLAN(vlan); err != nil {
			log.Fatalf("Failed to remove VLAN interface %v: %v", vlan, err)
		}
	}
	for _, vlan := range add {
		log.Infof("Adding VLAN interface %v", vlan)
		if err := e.lbInterface.AddVLAN(vlan); err != nil {
			log.Fatalf("Failed to add VLAN interface %v: %v", vlan, err)
		}
	}

	e.vlans = cluster.VLANs
}