// UpdatePort updates an OVS port without creating it
353752
func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, dscp int, skipVethPair bool) error {

	// Get OVS port name
	ovsPortName := getOvsPortName(intfName, skipVethPair)

	// Add the endpoint to ofnet
	// Get the openflow port number for the interface
	ofpPort, err := sw.ovsdbDriver.GetOfpPortNo(ovsPortName)
	if err != nil {
		log.Errorf("Could not find the OVS port %s. Err: %v", ovsPortName, err)
		return err
	}

	macAddr, _ := net.ParseMAC(cfgEp.MacAddress)

	// Build the endpoint info
	endpoint := ofnet.EndpointInfo{
		PortNo:            ofpPort,
		MacAddr:           macAddr,
		Vlan:              uint16(nwPktTag),
		IpAddr:            net.ParseIP(cfgEp.IPAddress),
		Ipv6Addr:          net.ParseIP(cfgEp.IPv6Address),
		EndpointGroup:     cfgEp.EndpointGroupID,
		EndpointGroupVlan: uint16(pktTag),
		Dscp:              dscp,
	}

	// Add the local port to ofnet
	if sw.ofnetAgent == nil {
		log.Infof("Skipping adding localport to ofnet")
		return nil
	}
	err = sw.ofnetAgent.AddLocalEndpoint(endpoint)
	if err != nil {
		log.Errorf("Error adding local port %s to ofnet. Err: %v", ovsPortName, err)
		return err
	}
	return nil
}
649778
func (s *GameSessionPlacement) SetPort(v int64) *GameSessionPlacement {
	s.Port = &v
	return s
}
220727
func (c *Client) UpdateHost(p *UpdateHostParameter) (*Host, error) {
	obj, err := c.Request("updateHost", convertParamToMap(p))
	if err != nil {
		return nil, err
	}
	return obj.(*Host), err
}
1048893
func (inst *environInstance) OpenPorts(ctx context.ProviderCallContext, machineID string, rules []network.IngressRule) error {
	return inst.changeIngressRules(ctx, true, rules)
}
275584
func (s *TargetDescription) SetPort(v int64) *TargetDescription {
	s.Port = &v
	return s
}
890495
func (s *UpdateHealthCheckInput) SetPort(v int64) *UpdateHealthCheckInput {
	s.Port = &v
	return s
}
706809
func (s *GameSession) SetPort(v int64) *GameSession {
	s.Port = &v
	return s
}
227372
func (vrsConnection *VRSConnection) RemovePortFromAlubr0(portName string) error {

	condition := libovsdb.NewCondition("name", "==", portName)
	selectOp := libovsdb.Operation{
		Op:    "select",
		Table: "Port",
		Where: []interface{}{condition},
	}

	selectOperation := []libovsdb.Operation{selectOp}
	reply, err := vrsConnection.ovsdbClient.Transact(OvsDBName, selectOperation...)
	if err != nil || len(reply) != 1 || len(reply[0].Rows) != 1 {
		return fmt.Errorf("Problem selecting row in the OVSDB Port table for alubr0")
	}

	// Obtain Port table OVSDB row corresponding to the port name
	ovsdbRow := reply[0].Rows[0]
	portUUID := ovsdbRow["_uuid"]
	portUUIDStr := fmt.Sprintf("%v", portUUID)
	portUUIDNew := util.SplitUUIDString(portUUIDStr)

	condition = libovsdb.NewCondition("name", "==", portName)
	deleteOp := libovsdb.Operation{
		Op:    "delete",
		Table: "Port",
		Where: []interface{}{condition},
	}

	// Deleting a Bridge row in Bridge table requires mutating the open_vswitch table.
	mutateUUID := []libovsdb.UUID{libovsdb.UUID{portUUIDNew}}
	mutateSet, _ := libovsdb.NewOvsSet(mutateUUID)
	mutation := libovsdb.NewMutation("ports", "delete", mutateSet)
	condition = libovsdb.NewCondition("name", "==", bridgeName)

	// simple mutate operation
	mutateOp := libovsdb.Operation{
		Op:        "mutate",
		Table:     "Bridge",
		Mutations: []interface{}{mutation},
		Where:     []interface{}{condition},
	}

	operations := []libovsdb.Operation{deleteOp, mutateOp}
	reply, err = vrsConnection.ovsdbClient.Transact(OvsDBName, operations...)
	if err != nil || len(reply) < len(operations) {
		return fmt.Errorf("Problem mutating row in the OVSDB Bridge table for alubr0")
	}

	return nil
}
456029
func (i sigmaInstance) OpenPorts(ctx context.ProviderCallContext, machineID string, ports []network.IngressRule) error {
	return errors.NotImplementedf("OpenPorts")
}
1257499
func (vrsConnection *VRSConnection) DeregisterForPortUpdates(brport string) error {
	vrsConnection.registrationChannel <- &Registration{Brport: brport, Channel: nil, Register: false}
	return nil
}
143325
func (s *OptionConfiguration) SetPort(v int64) *OptionConfiguration {
	s.Port = &v
	return s
}
1245065
func (s *PlayerSession) SetPort(v int64) *PlayerSession {
	s.Port = &v
	return s
}
534734
func (s *CreateDBInstanceInput) SetPort(v int64) *CreateDBInstanceInput {
	s.Port = &v
	return s
}
906058
func (s *CreateReplicationGroupInput) SetPort(v int64) *CreateReplicationGroupInput {
	s.Port = &v
	return s
}
1216870
func (s *PendingModifiedValues) SetPort(v int64) *PendingModifiedValues {
	s.Port = &v
	return s
}
617471
func (s *PortManager) ReleasePort(networks []tcpip.NetworkProtocolNumber, transport tcpip.TransportProtocolNumber, addr tcpip.Address, port uint16) {
	s.mu.Lock()
	defer s.mu.Unlock()

	for _, network := range networks {
		desc := portDescriptor{network, transport, port}
		if m, ok := s.allocatedPorts[desc]; ok {
			n, ok := m[addr]
			if !ok {
				continue
			}
			n.refs--
			if n.refs == 0 {
				delete(m, addr)
			} else {
				m[addr] = n
			}
			if len(m) == 0 {
				delete(s.allocatedPorts, desc)
			}
		}
	}
}
681671
func (s *ServiceRegistry) SetPort(v int64) *ServiceRegistry {
	s.Port = &v
	return s
}