pffindproto Kernel Service

Purpose

Returns the address of a protocol switch table entry.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/domain.h>

struct protosw *pffindproto (family, protocol, type)
int  family;
int  protocol;
int  type;

Parameters

Item Description
family Specifies the address family for which to search.
protocol Indicates the protocol within the address family.
type Specifies the type of socket (for example, SOCK_RAW).

Description

The pffindproto kernel service first searches the domain switch table for the address family specified by the family parameter. If found, the pffindproto service then searches the protocol switch table for that domain and checks for matches with the type and protocol parameters.

If a match is found, the pffindproto service returns the address of the protocol switch table entry. If the type parameter is set to SOCK_RAW, the pffindproto service returns the first entry it finds with protocol equal to 0 and type equal to SOCK_RAW.

Execution Environment

The pffindproto kernel service can be called from either the process or interrupt environment.

Return Values

The pffindproto service returns a null value if a protocol switch table entry was not found for the given search criteria. Upon success, the pffindproto service returns the address of a protocol switch table entry.