Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC
ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference

 


IONetworkLib.h

Includes:

Overview

This header defines functions you use to open and close connections to IONetworkInterface objects and to read from and write to the buffers of network data objects.



Functions

IONetworkClose
Close the connection to an IONetworkInterface object.
IONetworkGetDataCapacity
Get the capacity (in bytes) of a network data object.
IONetworkGetDataHandle
Get the handle of a network data object with the given name.
IONetworkGetPacketFiltersMask
Get the packet filters for a given filter group.
IONetworkOpen
Open a connection to an IONetworkInterface object. An IONetworkUserClient object is created to manage the connection.
IONetworkReadData
Read the buffer of a network data object.
IONetworkResetData
Fill the buffer of a network data object with zeroes.
IONetworkSetPacketFiltersMask
Set the packet filters for a given filter group.
IONetworkWriteData
Write to the buffer of a network data object.

IONetworkClose


Close the connection to an IONetworkInterface object.

IOReturn IONetworkClose(
    io_connect_t con);  


IONetworkGetDataCapacity


Get the capacity (in bytes) of a network data object.

IOReturn IONetworkGetDataCapacity(
    io_connect_t conObject, 
    IONDHandle dataHandle, 
    UInt32 *capacityP);  
Parameters
conObject
The connection object.
dataHandle
The handle of a network data object.
capacityP
Upon success, the capacity is written to this address.
Return Value

kIOReturnSuccess on success, or an error code otherwise.


IONetworkGetDataHandle


Get the handle of a network data object with the given name.

IOReturn IONetworkGetDataHandle(
    io_connect_t conObject, 
    const char *dataName, 
    IONDHandle *dataHandleP);  
Parameters
conObject
The connection object.
dataName
The name of the network data object.
dataHandleP
Upon success, the handle is written to this address.
Return Value

kIOReturnSuccess on success, or an error code otherwise.


IONetworkGetPacketFiltersMask


Get the packet filters for a given filter group.

IOReturn IONetworkGetPacketFiltersMask(
    io_connect_t connect, 
    const io_name_t filterGroup, 
    UInt32 *filtersMask, 
    IOOptionBits options );  
Parameters
connect
The connection object returned from IONetworkOpen().
filterGroup
The name of the packet filter group.
filtersMask
Pointer to the return value containing a mask of packet filters.
options
kIONetworkSupportedPacketFilters may be set to fetch the filters that are supported by the hardware.
Return Value

An IOReturn error code.

Discussion

A network controller may support a number of packets filters that can accept or reject a type of packet seen on the network. A filter group identifies a set of related filters, such as all filters that will allow a packet to pass upstream based on the destination address encoded within the packet. This function allows an user-space program to get the filtering performed by a given filter group.


IONetworkOpen


Open a connection to an IONetworkInterface object. An IONetworkUserClient object is created to manage the connection.

IOReturn IONetworkOpen(
    io_object_t obj,
    io_connect_t *con);  


IONetworkReadData


Read the buffer of a network data object.

IOReturn IONetworkReadData(
    io_connect_t conObj, 
    IONDHandle dataHandle, 
    UInt8 *destBuf, 
    UInt32 *inOutSizeP);  
Parameters
conObj
The connection object.
dataHandle
The handle of a network data object.
destBuf
The buffer where the data read shall be written to.
inOutSizeP
Pointer to an integer that the caller must initialize to contain the size of the buffer. This function will overwrite it with the actual number of bytes written to the buffer.
Return Value

kIOReturnSuccess on success, or an error code otherwise.


IONetworkResetData


Fill the buffer of a network data object with zeroes.

IOReturn IONetworkResetData(
    io_connect_t conObject,
    IONDHandle dataHandle);  
Parameters
conObject
The connection object.
dataHandle
The handle of a network data object.
Return Value

kIOReturnSuccess on success, or an error code otherwise.


IONetworkSetPacketFiltersMask


Set the packet filters for a given filter group.

IOReturn IONetworkSetPacketFiltersMask(
    io_connect_t connect, 
    const io_name_t filterGroup, 
    UInt32 filtersMask, 
    IOOptionBits options );  
Parameters
connect
The connection object returned from IONetworkOpen().
filterGroup
The name of the packet filter group.
filtersMask
A mask of filters to set.
options
No options are currently defined.
Return Value

An IOReturn error code.

Discussion

A network controller may support a number of packets filters that can accept or reject a type of packet seen on the network. A filter group identifies a set of related filters, such as all filters that will allow a packet to pass upstream based on the destination address encoded within the packet. This function allows an user-space program to set the filtering performed by a given filter group.


IONetworkWriteData


Write to the buffer of a network data object.

IOReturn IONetworkWriteData(
    io_connect_t conObj, 
    IONDHandle dataHandle, 
    UInt8 *srcBuf, 
    UInt32 inSize);  
Parameters
conObj
The connection object.
dataHandle
The handle of a network data object.
srcBuf
The data to write is taken from this buffer.
inSize
The size of the source buffer.
Return Value

kIOReturnSuccess on success, or an error code otherwise.

Enumerations


IONetworkPacketFilterOptions


enum { 
    kIONetworkSupportedPacketFilters = 0x0001 
};  
Constants
kIONetworkSupportedPacketFilters
Indicate the filters that are supported by the hardware.




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11