tcp_RegCatchall(3z)

πŸ“¦ version 1.10.1, in fedora 43, fedora 44

✨ 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 TRUE when it has received an ICMP reply packet of the correct tyoe, and FALSE otherwise.
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