Description
Get protocol information corresponding to a protocol number.
#include <winsock.h>
struct protoent FAR * PASCAL FAR getprotobynumber ( int number );
number
Remarks
This function returns a pointer to a protoent structure as described above in getprotobyname(). The contents of the structure correspond to the given protocol number. The pointer which is returned points to a structure which is allocated by the Windows Sockets implementation. The application must never attempt to modify this structure or to free any of its components. Furthermore, only one copy of this structure is allocated per thread, and so the application should copy any information which it needs before issuing any other Windows Sockets API calls.
Return Value
If no error occurs, getprotobynumber() returns a pointer to the protoent structure described above. Otherwise it returns a NULL pointer and a specific error number may be retrieved by calling WSAGetLastError().
Error Codes
WSANOTINITIALISED
See Also
WSAAsyncGetProtoByNumber(), getprotobyname()