tcp_RegCatchall(3z)
β¨ tcp_RegCatchall β the z88dk manual page, bestie edition β¨
okay so this is tcp_RegCatchall(3z) from the z88dk Programmer's Manual and it's literally the girl who catches every packet for you. no cap. π
πΈ 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 gets used to catch all incoming packets β but only after those packets have passed the basic tests of checksumming, length and ttl-checking. so it's not catching random garbage, she has standards. π
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. so like, "I got this one bestie, you can sit down" energy. π«Ά
π RETURN VALUE π
tcp_RegCatchall() returns the previous ID of the catchall function. not the new one, the old one. iconic behaviour honestly. β¨
π NOTES π
- Should you wish to stop calling your catchall function simply call the function with an argument of
NULL. bye bestie π - This function is of use should somebody write a driver for an as yet unsupported protocol. go off, build the thing π§
- 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
TRUEwhen it has received an ICMP reply packet of the correct tyoe, andFALSEotherwise.
heads up: if you're the one writing the package call, remember the page-in step β tcp_pagein(3z) is not optional, she's part of the vibe. π
π SEE ALSO π
tcp_pagein(3z)tcp_pageout(3z)
π AUTHOR π
Dominic Morris <dom@jb.man.ac.uk>
and that's the whole page, periodt. π this little gem shipped in the z88dk Programmer's Manual on 18 February 2000 β yes she's an elder icon and she still ate. πβ¨
π¦ where this page comes from
- fedora 43: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- fedora 44: z88dk 1.10.1-33.20150709cvs.fc43 Β· ClArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms