ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
IONetworkInterface |
Inherits from: | |
Declared In: |
Abstract class that manages the connection between an IONetworkController and the data link interface layer.
An IONetworkInterface object manages the connection between an IONetworkController and the data link interface layer (DLIL). All interactions between the controller and DLIL must go through an interface object. Any data structures that are required by DLIL for a particular interface type shall be allocated and mantained by the interface object. IONetworkInterface is an abstract class that must be extended by a concrete subclass to specialize for a particular network type.
Although most drivers will allocate a single interface object, it is possible for multiple interfaces to be attached to a single controller. This controller driver will be responsible for arbitrating access among its multiple interface clients.
IONetworkInterface also maintains a dictionary of IONetworkData objects containing statistics structures. Controller drivers can ask for a particular data object by name and update the statistics counters within directly. This dictionary is added to the interface's property table and is visible outside of the kernel.
Adds an IONetworkData object to a dictionary managed by the interface.
Attaches the network interface to the data link layer.
Removes and discards all packets in the input queue.
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
Sends a notification that the interface has opened the network controller.
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
Sends a notification that the interface will close the network controller.
Detaches the network interface from the data link layer.
Feed received packets to the BPF
Feed sent packets to the BPF
Feed received packets to the BPF
Feed sent packets to the BPF
Sends all packets held in the input queue to the data link layer.
Frees the IONetworkInterface object.
Returns the provider, an IONetworkController object, that is servicing this interface object.
Gets the value of the interface extra flags.
Gets the value of the interface flags.
Gets the ifnet structure allocated by the interface object.
Reports the current state of the interface object by returning the interface state flags.
Gets the interface type.
Gets the maximum transfer unit for this interface.
Gets the size of the media (MAC-layer) address.
Gets the size of the media header.
Returns a string containing the prefix to use when creating a BSD name for this interface.
Gets an IONetworkData object from the interface that is associated with the given key.
Gets an IONetworkData object from the interface that is associated with the given key.
Gets the unit number assigned to this interface object.
Handles a client close on the interface.
Handles a client open on the interface.
Handles a client close on the interface.
Queries whether a client has an open on the interface.
Handles a client open on the interface.
Initializes an IONetworkInterface object.
Initializes the ifnet structure given.
Sends an event to the data link layer.
Submits a single packet received from the network to the data link layer.
Queries whether the interface object provided represents the "primary" network interface for the system.
Returns true if the interface has been registered with the data link layer.
Takes the network interface lock.
Overrides the implementation in IOService to implement family-specific matching.
Creates a connection for a non kernel client.
Handles an ioctl command sent to the network interface.
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
Registers a target/action to handle output packets.
Removes an entry from the IONetworkData dictionary managed by the interface.
Removes an entry from the IONetworkData dictionary managed by the interface.
Performs a read-modify-write operation on the current interface extra flags value.
Performs a read-modify-write operation on the current interface flags value.
Updates the interface object state flags.
Sest the interface type.
Sets the maximum transfer unit for this interface.
Sets the size of the media (MAC-layer) address.
Sets the size of the media header.
Handles a request to set network interface properties from kernel or non-kernel clients.
Assigns a unique unit number to this interface.
Releases the network interface lock.
addNetworkData |
Adds an IONetworkData object to a dictionary managed by the interface.
public
virtual bool addNetworkData( IONetworkData *aData);
aData
An IONetworkData object to be added to a dictionary managed by the interface. This object is retained by the dictionary.
Returns true if the operation was successful, false otherwise.
attachToDataLinkLayer |
Attaches the network interface to the data link layer.
public
virtual IOReturn attachToDataLinkLayer( IOOptionBits options, void *parameter );
options
Options for the attach call. None are currently defined.
parameter
Parameter for the attach call. Not currently used.
Returns kIOReturnSuccess on success.
This function is called by the family to attach the network interface managed by an IONetworkInterface to the data link layer. This call occurs after the interface initialization and setup, including the assignment of an interface unit number. Prior to the data link attach, services provided by an IONetworkInterface will be inaccessible to BSD networking, though the object can be found in the I/O Kit Registry. Subclasses can extend this function to perform additional work that is specific to a type of interface.
clearInputQueue |
Removes and discards all packets in the input queue.
public
virtual UInt32 clearInputQueue();
Returns the number of packets freed.
This method removes all packets from the input queue and releases them back to the free mbuf pool. Also see flushInputQueue().
controllerDidChangePowerState |
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
protected
virtual IOReturn controllerDidChangePowerState( IONetworkController *controller, IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker);
controller
The network controller object.
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller has switched to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
The return value is always kIOReturnSuccess.
controllerDidOpen |
Sends a notification that the interface has opened the network controller.
protected
virtual bool controllerDidOpen( IONetworkController *controller);
controller
The controller that was opened.
Must return true in order for handleOpen() to accept the client open. If the return is false, then the controller will be closed and the client open will be refused.
This method is called by handleOpen() to notify subclasses that the controller has been opened. The open on the controller is done when the interface receives the initial open request from a client. Subclasses can override this method and inspect the controller before allowing the client open. The implementation in the subclass must first call the method in super and check the return value. This method is called with our arbitration lock held, hence issuing I/O to the controller must be avoided to eliminate the possibility of a deadlock.
controllerWillChangePowerState |
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
protected
virtual IOReturn controllerWillChangePowerState( IONetworkController *controller, IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker);
controller
The network controller object.
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller is switching to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
The return value is always kIOReturnSuccess.
controllerWillClose |
Sends a notification that the interface will close the network controller.
protected
virtual void controllerWillClose( IONetworkController *controller);
controller
The controller that is about to be closed.
This method is called by handleClose() after receiving a close from the last client, and just before the controller is closed. Subclasses can override this method to perform any cleanup action before the controller is closed. This method is called with our arbitration lock held, hence issuing I/O to the controller must be avoided to eliminate the possibility of a deadlock.
detachFromDataLinkLayer |
Detaches the network interface from the data link layer.
public
virtual void detachFromDataLinkLayer( IOOptionBits options, void *parameter );
options
Options for the detach call. None are currently defined.
parameter
Parameter for the detach call. Not currently used.
This function is called by the family to detach the network interface managed by an IONetworkInterface from the data link layer. This call is made when the interface is terminated, before the last close. Subclasses can extend this function to perform additional work that is specific to a type of interface.
feedInputPacketTap |
Feed received packets to the BPF
protected
virtual void feedPacketInputTap( mbuf_t);
mbuf
Pointer to the packet.
This function is called by the family for each inbound packet to feed it to the BPF function. Interface classes can override if they need to provide class specific functionality or modifications to the BPF tap.
feedOutputPacketTap |
Feed sent packets to the BPF
protected
virtual void feedPacketOutputTap( mbuf_t);
mbuf
Pointer to the packet.
This function is called by the family for each outbound packet to feed it to the BPF function. Interface classes can override if they need to provide class specific functionality or modifications to the BPF tap.
feedPacketInputTap |
Feed received packets to the BPF
protected
virtual void feedPacketInputTap( mbuf_t);
mbuf
Pointer to the packet.
This function is called by the family for each inbound packet to feed it to the BPF function. Interface classes can override if they need to provide class specific functionality or modifications to the BPF tap.
feedPacketOutputTap |
Feed sent packets to the BPF
protected
virtual void feedPacketOutputTap( mbuf_t);
mbuf
Pointer to the packet.
This function is called by the family for each outbound packet to feed it to the BPF function. Interface classes can override if they need to provide class specific functionality or modifications to the BPF tap.
flushInputQueue |
Sends all packets held in the input queue to the data link layer.
public
virtual UInt32 flushInputQueue();
Returns the number of packets that were submitted to the data link layer. May be zero if the queue was empty.
Remove all packets from the input queue and send them to the data link layer by calling dlil_input(). This method should be used in connection with the inputPacket() method, to flush the input queue after inputPacket() was used to queue up some number of received packets. See inputPacket() and clearInputQueue().
free |
Frees the IONetworkInterface object.
protected
virtual void free();
Resource allocated by init() are released, and clearInputQueue() is called to ensure that the input queue is empty.
getController |
Returns the provider, an IONetworkController object, that is servicing this interface object.
public
virtual IONetworkController * getController() const;
Returns the IONetworkController object that is providing service to this interface object.
This is the same controller object that was supplied as an argument to the init() method.
getExtraFlags |
Gets the value of the interface extra flags.
public
virtual UInt32 getExtraFlags() const;
Returns the value of the interface extra flags.
This method returns the value in the if_eflags field in the ifnet structure.
getFlags |
Gets the value of the interface flags.
public
virtual UInt16 getFlags() const;
Returns the value of the interface flags.
This method returns the value in the if_flags field in the ifnet structure.
getIfnet |
Gets the ifnet structure allocated by the interface object.
protected
virtual ifnet_t getIfnet() const;
Returns the ifnet_t object that is attached to the datalink layer.
Reveal the interface's ifnet_t. The ifnet_t is managed primarily by IONetworkInterface, however this method can be called when the sub-class needs to call interface KPI functions directly.
getInterfaceState |
Reports the current state of the interface object by returning the interface state flags.
public
virtual UInt32 getInterfaceState() const;
Returns the interface state flags.
getInterfaceType |
Gets the interface type.
public
virtual UInt8 getInterfaceType() const;
Returns a constant defined in bsd/net/if_types.h header file that describes the interface type.
This method returns the value in the if_type field in the ifnet structure.
getMaxTransferUnit |
Gets the maximum transfer unit for this interface.
public
virtual UInt32 getMaxTransferUnit() const;
Returns the interface MTU size in bytes.
This method returns the value in the if_mtu field in the ifnet structure.
getMediaAddressLength |
Gets the size of the media (MAC-layer) address.
public
virtual UInt8 getMediaAddressLength() const;
Returns the size of the media address in bytes.
This method returns the value in the if_addrlen field in the ifnet structure.
getMediaHeaderLength |
Gets the size of the media header.
public
virtual UInt8 getMediaHeaderLength() const;
Returns the size of the media header in bytes.
This method returns the value in the if_hdrlen field in the ifnet structure.
getNamePrefix |
Returns a string containing the prefix to use when creating a BSD name for this interface.
public
virtual const char * getNamePrefix() const = 0;
Returns a pointer to a constant C string.
The BSD name for each interface object is generated by concatenating a string returned by this method, with an unique unit number assigned by IONetworkStack. A concrete subclass of IONetworkInterface must implement this method and enforce a consistent name for all of its instances.
getNetworkData(const char *) |
Gets an IONetworkData object from the interface that is associated with the given key.
public
virtual IONetworkData * getNetworkData( const char * aKey) const;
aKey
The unique string identifying the IONetworkData object to be returned to caller.
Returns a reference to the matching IONetworkData object, or 0 if no match was found.
getNetworkData(const OSSymbol *) |
Gets an IONetworkData object from the interface that is associated with the given key.
public
virtual IONetworkData * getNetworkData( const OSSymbol * aKey) const;
aKey
The unique OSSymbol identifying the IONetworkData object to be returned to caller.
Returns a reference to the matching IONetworkData object, or 0 if no match was found.
getUnitNumber |
Gets the unit number assigned to this interface object.
public
virtual UInt16 getUnitNumber() const;
Returns the assigned interface unit number.
This method returns the value in the if_unit field in the ifnet structure.
handleClientClose |
Handles a client close on the interface.
protected
virtual void handleClientClose( IOService *client, IOOptionBits options);
client
The client object requesting the close.
options
Options passed to IONetworkInterface::handleClose().
This method is called by handleClose() to handle a close from a client object. Unlike handleClose(), subclasses may override this method to catch a close reuqest from a client. This method is called with the arbitration lock held.
handleClientOpen |
Handles a client open on the interface.
protected
virtual bool handleClientOpen( IOService *client, IOOptionBits options, void *argument);
client
The client object requesting the open.
options
Options passed to IONetworkInterface::handleOpen().
argument
Argument passed to IONetworkInterface::handleOpen().
Returns true to accept the client open, false to refuse it.
This method is called by handleOpen() to handle an open from a client object. Unlike handleOpen(), subclasses may override this method to catch an open request from a client. This method is called with the arbitration lock held.
handleClose |
Handles a client close on the interface.
protected
virtual void handleClose( IOService *client, IOOptionBits options);
client
The client object that requested the close.
options
Options passed to IOService::close().
This method is called by IOService::close() with the arbitration lock held. This method will in turn call handleClientClose() to notify interested subclasses about the client close. If this represents the last close, then the interface will also close the controller before this method returns. The controllerWillClose() method will be called before closing the controller. Subclasses should not override this method.
handleIsOpen |
Queries whether a client has an open on the interface.
protected
virtual bool handleIsOpen( const IOService * client) const;
Returns true if the specified client, or any client if none (0) is specified, presently has an open on this object.
This method is always called by IOService with the arbitration lock held. Subclasses should not override this method.
handleOpen |
Handles a client open on the interface.
protected
virtual bool handleOpen( IOService *client, IOOptionBits options, void *argument);
client
The client object that requested the open.
options
Options passed to IOService::open().
argument
Argument passed to IOService::open().
Returns true to accept the client open, false otherwise.
This method is called by IOService::open() with the arbitration lock held, and must return true to accept the client open. This method will in turn call handleClientOpen() to qualify the client requesting the open. Since the controller is opened by the interface in a lazy fashion, the interface may also perform an open on the controller before this method returns. If the controller was opened, then controllerDidOpen() is called to notify interested subclasses. Subclasses should not override this method.
init |
Initializes an IONetworkInterface object.
public
virtual bool init( IONetworkController *controller );
controller
A network controller object that will service the interface object being initialized.
Returns true on success, false otherwise.
Initializes instance variables, and allocates resources.
initIfnet |
Initializes the ifnet structure given.
protected
virtual bool initIfnet( struct ifnet *ifp);
ifp
Pointer to an ifnet structure obtained earlier through the getIfnet() method call.
Returns true on success, false otherwise.
A concrete subclass must override this method and initialize the ifnet structure given. The implementation in the subclass must call super before it returns, to allow IONetworkInterface to complete the initialization, and to insert the BSD shim functions implemented in IONetworkInterface to the appropriate function pointer fields in the ifnet structure. IONetworkInterface will call this method during its init() method. Subclasses are encouraged to use the ifnet accessor methods to update the ifnet structure when possible, since this will ensure that properties in the registry will also be updated to reflect any changes made.
inputEvent |
Sends an event to the data link layer.
public
virtual bool inputEvent( UInt32 type, void *data);
type
A constant describing the event type.
data
Data associated with the event.
Returns true if the event was delivered, false if the event type specified is invalid, or if the event delivery was unsuccesful.
This method can be used by the network controller to send an event to the data link layer.
inputPacket |
Submits a single packet received from the network to the data link layer.
public
virtual UInt32 inputPacket( mbuf_t, UInt32 length = 0, IOOptionBits options = 0, void *param = 0);
m
The mbuf containing the received packet.
length
Specify the size of the received packet in the mbuf. The mbuf length fields are updated with this value. If zero, then the mbuf length fields are not updated.
options
Options defined by inputPacket() that the caller can use to specify this method call.
param
A parameter provided by the caller. Not used by IONetworkInterface.
Returns the number of packets that were submitted to the data link layer, or 0 if the packet was queued.
This method is called by the network controller to submit a single packet received from the network to the data link layer. The packet received by this method may be added to an input queue on the interface object, which the controller can use to postpone the packet handoff to the upper layers, until all received packets have been transferred to the input queue. A subsequent call to flushInputQueue(), will transfer the entire contents of the queue to the data link layer, by making a single call to dlil_input(). Other methods that can be used to manage the input queue are flushInputQueue() and clearInputQueue(). This input queue is not protected by a lock. Access to the queue by the controller must be serialized, otherwise its use must be avoided.
isPrimaryInterface |
Queries whether the interface object provided represents the "primary" network interface for the system.
public
virtual bool isPrimaryInterface() const;
Returns true if the interface provided is the primary inteface, false otherwise.
isRegistered |
Returns true if the interface has been registered with the data link layer.
public
virtual bool isRegistered() const;
Returns true if interface is registered. Returns false if the data link layer has no references to this network interface, which implies that either the interface has yet to attach to the data link layer, or the interface has been detached.
Once registered, the interface will be assigned a BSD name (such as en0), and a kIOBSDNameKey property is added to the property table containing this name. Calling this method performs the same function as checking for the kIONetworkInterfaceRegisteredState bit in the value returned by getInterfaceState().
lock |
Takes the network interface lock.
protected
virtual void lock();
This method takes the recursive lock that protects the interface state. All updates to the interface state and to the ifnet structure must be performed while holding this lock. This call must be balanced by a subsequent call to unlock().
matchPropertyTable |
Overrides the implementation in IOService to implement family-specific matching.
public
virtual bool matchPropertyTable( OSDictionary *table, SInt32 *score );
table
The dictionary of properties to match against.
score
Pointer to the current driver's probe score, not used.
Returns true for a positive match, false otherwise.
When the gIOLocationMatchKey property is present in the dictionary provided, then fail the match unless the kIOBSDNameKey property is found. This is to prevent a premature match when hunting for a root device for BSD. The presence of the kIOBSDNameKey property indicates that the interface has registered with BSD, and is a valid candidate for matching against the gIOLocationMatchKey property. If the gIOLocationMatchKey property is absent, then this method will always return true.
newUserClient |
Creates a connection for a non kernel client.
protected
virtual IOReturn newUserClient( task_t owningTask, void *security_id, UInt32 type, IOUserClient **handler);
owningTask
The mach task requesting the connection.
security_id
A token representing the access level for the task.
type
A constant specifying the type of connection to be created. An IONetworkUserClient object is created if the type specified is kIONetworkUserClientTypeID.
handler
The IOUserClient object returned.
Returns kIOReturnSuccess if an IONetworkUserClient was created, kIOReturnNoMemory for a memory allocation error, or kIOReturnBadArgument if the type specified is unknown.
This method creates a new IOUserClient to service a connection to a non kernel client.
performCommand |
Handles an ioctl command sent to the network interface.
protected
virtual SInt32 performCommand( IONetworkController *controller, UInt32 cmd, void *arg0, void *arg1);
controller
The controller object.
cmd
The ioctl command code.
arg0
Command argument 0. Generally a pointer to an ifnet structure associated with the interface.
arg1
Command argument 1.
Returns a BSD return value defined in bsd/sys/errno.h.
This method handles socket ioctl commands sent to the network interface from DLIL. IONetworkInterface handles commands that are common for all network interface types. A subclass of IONetworkInterface may override this method to override the command handling in IONetworkInterface, or to extend the command processing to handle additional commands, and then call super for any commands not handled in the subclass. The ioctl commands handled by IONetworkInterface are SIOCGIFMTU (Get interface MTU size), SIOCSIFMTU (Set interface MTU size), SIOCSIFMEDIA (Set media), and SIOCGIFMEDIA (Get media and link status).
powerStateDidChangeTo |
Handles a notification that the network controller servicing this interface object has transitioned to a new power state.
protected
virtual IOReturn powerStateDidChangeTo( IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker );
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller has switched to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
The return will always be IOPMAckImplied to indicate that the preparation for the power change has already completed when this method returns.
This method will call the controllerDidChangePowerState() method on the controller's work loop context to prepare for the power state change. Subclasses should not override this method.
powerStateWillChangeTo |
Handles a notification that the network controller servicing this interface object is about to transition to a new power state.
protected
virtual IOReturn powerStateWillChangeTo( IOPMPowerFlags flags, UInt32 stateNumber, IOService *policyMaker );
flags
Flags that describe the capability of the controller in the new power state.
stateNumber
An index to a state in the network controller's power state array that the controller is switching to.
policyMaker
A reference to the network controller's policy-maker, and is also the originator of this notification.
The return will always be IOPMAckImplied to indicate that the preparation for the power change has already completed when this method returns.
This method will call the controllerWillChangePowerState() method on the controller's work loop context to prepare for the power state change. Subclasses should not override this method.
registerOutputHandler |
Registers a target/action to handle output packets.
public
virtual bool registerOutputHandler( OSObject *target, IOOutputAction action);
target
Target object that implements the output handler.
action
The function that will process output packets.
Returns true if the target/action provided was accepted, false otherwise.
The interface object will forward all output packets, received from the data link layer, to the output handler registered through this method. The default target and action are set by the init() method to the controller, and the handler returned by the controller's getOutputHandler() method. Once the interface becomes registered with the data link layer, this method will return false and will reject any further changes.
removeNetworkData(const char *) |
Removes an entry from the IONetworkData dictionary managed by the interface.
public
virtual bool removeNetworkData( const char * aKey);
aKey
A unique string identifying the IONetworkData object to be removed from the dictionary.
Returns true if the operation was successful, false otherwise.
This method removes an entry from the IONetworkData dictionary managed by the interface. The removed object is released.
removeNetworkData(const OSSymbol *) |
Removes an entry from the IONetworkData dictionary managed by the interface.
public
virtual bool removeNetworkData( const OSSymbol * aKey);
aKey
A unique OSSymbol identifying the IONetworkData object to be removed from the dictionary.
Returns true if the operation was successful, false otherwise.
This method removes an entry from the IONetworkData dictionary managed by the interface. The removed object is released.
setExtraFlags |
Performs a read-modify-write operation on the current interface extra flags value.
protected
virtual bool setExtraFlags( UInt32 flags, UInt32 clear = 0);
flags
The bits that should be set.
flags
The bits that should be set.
clear
The bits that should be cleared. If 0, then non of the flags are cleared and the result is formed by OR'ing the original flags with the new flags.
Returns true if the update was successful, false otherwise.
See bsd/net/if.h header file for the definition of the extra flag constants. Both the if_eflags field in the ifnet structure, and the kIOInterfaceExtraFlags property are updated with the value provided.
setFlags |
Performs a read-modify-write operation on the current interface flags value.
protected
virtual bool setFlags( UInt16 flags, UInt16 clear = 0);
flags
The bits that should be set.
clear
The bits that should be cleared. If 0, then non of the flags are cleared and the result is formed by OR'ing the original flags value with the new flags.
Returns true if the update was successful, false otherwise.
See bsd/net/if.h header file for the definition of the flag constants. Both the if_flags field in the ifnet structure, and the kIOInterfaceFlags property are updated with the value provided.
setInterfaceState |
Updates the interface object state flags.
protected
virtual UInt32 setInterfaceState( UInt32 set, UInt32 clear = 0 );
flags
The bits that should be set.
clear
The bits that should be cleared.
Returns the resulting interface state flags following any changes made by this method.
The kIOInterfaceState property is updated with the value provided.
setInterfaceType |
Sest the interface type.
protected
virtual bool setInterfaceType( UInt8 type);
type
A constant defined in bsd/net/if_types.h header file that describes the interface type.
Returns true if the update was successful, false otherwise.
Both the if_type field in the ifnet structure, and the kIOInterfaceType property are updated with the value provided.
setMaxTransferUnit |
Sets the maximum transfer unit for this interface.
protected
virtual bool setMaxTransferUnit( UInt32 mtu);
mtu
The interface MTU size in bytes.
Returns true if the update was successful, false otherwise.
Both the if_mtu field in the ifnet structure, and the kIOMaxTransferUnit property are updated with the value provided.
setMediaAddressLength |
Sets the size of the media (MAC-layer) address.
protected
virtual bool setMediaAddressLength( UInt8 length);
length
The size of the media address in bytes.
Returns true if the update was successful, false otherwise.
Both the if_addrlen field in the ifnet structure, and the kIOMediaAddressLength property are updated with the value provided.
setMediaHeaderLength |
Sets the size of the media header.
protected
virtual bool setMediaHeaderLength( UInt8 length);
length
The size of the media header in bytes.
Returns true if the update was successful, false otherwise.
Both the if_hdrlen field in the ifnet structure, and the kIOMediaHeaderLength property are updated with the value provided.
setProperties |
Handles a request to set network interface properties from kernel or non-kernel clients.
public
virtual IOReturn setProperties( OSObject *properties );
properties
An OSDictionary containing a collection of properties.
Returns kIOReturnUnsupported if the interface did not recognize any of the properties provided. Otherwise, the return code will be kIOReturnSuccess to indicate no errors, or an IOReturn error code to indicate that an error occurred while handling one of the properties.
For non-kernel clients, the preferred access mechanism is through a user client connection.
setUnitNumber |
Assigns a unique unit number to this interface.
protected
virtual bool setUnitNumber( UInt16 unit);
unit
The unit number assigned to this interface object.
Returns true if the update was successful, false otherwise.
This method is called by IONetworkStack before the interface is registered with the data link layer, to assign a unique unit number to the interface object. Both the if_unit field in the ifnet structure, and the kIOInterfaceUnit property are updated with the value provided.
unlock |
Releases the network interface lock.
protected
virtual void unlock();
This method releases the recursive lock that protects the interface state to balance a previous lock() call.
_reserved |
private
ExpansionData * _reserved;
Reserved for future use. (Internal use only)
reserved |
private
ExpansionData * _reserved;
Reserved for future use. (Internal use only)
InputOptionQueuePacket |
public
enum { kInputOptionQueuePacket = 0x1 };
kInputOptionQueuePacket
Keep the packet provided in the input packet queue. No packets are sent to the data link layers, and the caller's thread will not venture outside the interface object. Calls to inputPacket() must be serialized.
The option bits that can be specified in the options argument when calling inputPacket().
|
Last Updated: 2008-12-19