Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

net_phygetnext(9f) [opensolaris man page]

net_phygetnext(9F)					   Kernel Functions for Drivers 					net_phygetnext(9F)

NAME
net_phygetnext - search through the current list of network interfaces SYNOPSIS
#include <sys/neti.h> phy_if_t net_phygetnext(const net_data_t net, const phy_if_t ifp); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
net value returned from a successful call to net_protocol_lookup(9F). ifp value returned from a successful call to this function or net_phylookup(9F). DESCRIPTION
The net_phygetnext() function searches through all of the network interfaces that a network protocol "owns". To start searching through all of the interfaces owned by a protocol, a value of 0 should be passed through as the value of ifp. When 0 is returned by this function, the last of the interfaces owned by this protocol has been reached. When called successfully, the value returned represents a network interface that exists, at the time of the call, within the scope of the network interface. This value is only guaranteed to be unique for a name within the scope of the network protocol. EXAMPLES
net_data_t net; phy_if_t ifp; char buffer[32]; net = net_protocol_lookup("inet"); if (net != NULL) { for (ifp = net_phygetnext(net, 0); ifp != 0; ifp = net_phygetnext(net, ifp)) { /* Do something with ifp */ if (net_getifname(net, ifp, buffer, sizeof(buffer) >= 0) printf("Interface %s0, buffer); } } RETURN VALUES
The net_phygetnext() function returns -1 if it is not supported by the network protocol or 0 if an attempt to go beyond the last network interface is made. Otherwise, it returns a value representing a network interface. CONTEXT
The net_phygetnext() function may be called from user, kernel, or interrupt context. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
net_phylookup(9F), net_protocol_lookup(9F), attributes(5) SunOS 5.11 1 May 2008 net_phygetnext(9F)

Check Out this Related Man Page

net_inject(9F)						   Kernel Functions for Drivers 					    net_inject(9F)

NAME
net_inject - determine if a network interface name exists for a network protocol SYNOPSIS
#include <sys/neti.h> int net_inject(const net_data_t net, inject_t style, net_inject_t *packet); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
net value returned from a successful call to net_protocol_lookup(9F). style method that determines how this packet is to be injected into the network or kernel. packet details about the packet to be injected. DESCRIPTION
The net_inject() function provides an interface to allow delivery of network layer (layer 3) packets either into the kernel or onto the network. The method of delivery is determined by style. If NI_QUEUE_IN is specified, the packet is scheduled for delivery up into the kernel, imitating its reception by a network interface. In this mode, packet->ni_addr is ignored and packet->ni_physical specifies the interface for which the packet is made to appear as if it arrived on. If NI_QUEUE_OUT is specified, the packet is scheduled for delivery out of the kernel, as if it were being sent by a raw socket. In this mode, packet->ni_addr and packet->ni_physical are both ignored. Neither NI_QUEUE_IN or NI_QUEUE_OUT cause the packet to be immediately processed by the kernel. Instead, the packet is added to a list and a timeout is scheduled (if there are none already pending) to deliver the packet. The call to net_inject() returns once the setup has been completed, and not after the packet has been processed. The packet processing is completed on a different thread and in a different context to that of the original packet. Thus, a packet queued up using net_inject() for either NI_QUEUE_IN or NI_QUEUE_OUT is presented to the packet event again. A packet received by a hook from NH_PHYSICAL_IN and then queued up with NI_QUEUE_IN is seen by the hook as another NH_PHYSICAL_IN packet. This also applies to both NH_PHYSICAL_OUT and NI_QUEUE_OUT packets. If NI_DIRECT_OUT is specified, an attempt is made to send the packet out to a network interface immediately. No processing on the packet, aside from prepending any required layer 2 information, is made. In this instance, packet->ni_addr may be used to specify the next hop (for the purpose of link layer address resolution) and packet->ni_physical determines which interface the packet should be sent out. For all three packets, packet->ni_packet must point to an mblk structure with the packet to be delivered. See net_inject_t(9S) for more details on the structure net_inject_t. RETURN VALUES
The net_inject() function returns: -1 The network protocol does not support this function. 0 The packet is successfully queued or sent. 1 The packet could not be queued up or sent out immediately. CONTEXT
The net_inject() function may be called from user, kernel, or interrupt context. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
net_protocol_lookup(9F), netinfo(9F), net_inject_t(9S) SunOS 5.11 1 May 2008 net_inject(9F)
Man Page