tcp_RegCatchall(3z)

NAME
tcp_RegCatchall - (De)register packet catcher

SYNOPSIS
#include <net/misc.h>

int tcp_RegCatchall(int libcall);

DESCRIPTION
The tcp_RegCatchall() function registers or deregisters a function that is used to catch all incoming packets after it has passed the basic tests of checksumming, length and ttl-checking. l-checking.

The parameter libcall is the ID for a shared library/packet call which has the prototype thus:

bool_t Function(void *dp, size_t len);

Where dp is the address of the packet and len is the length of the packet. This function should return TRUE/FALSE to indicate to the ZSock kernel whether the function has dealt with the packet and ZSock should not process it.

RETURN VALUE
tcp_RegCatchall() returns the previous ID of the catchall function.

NOTES
Should you wish to stop calling your catchall function simply call the function with an argument of NULL.

This function is of use should somebody write a driver for an as yet unsupported protocol.

The package call should page in the ZSock data area using the function tcp_pagein(3z).

This call could for example be used to implement a traceroute style routine to catch ICMP replies. Returning TRUE when it has received an ICMP reply packet of the correct tyoe, and FALSE otherwise.

SEE ALSO
tcp_pagein(3z), tcp_pageout(3z)

AUTHOR
Dominic Morris <dom@jb.man.ac.uk>