getservprotobyname(3z)

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

πŸ’– NAME πŸ’–

getservprotobyname, getservprotobyport β€” get servprotoice entry 🫢


🌸 SYNOPSIS 🌸

#include <net/resolv.h>

u8_t getservprotobyname(char *name);
u8_t getservprotobyport(tcpport_t port);

✨ DESCRIPTION ✨

okay bestie so these two are the little matchmakers that hook you up with the right protocol for a service πŸ’…

  • getservprotobyname() β€” hands you back the appropriate protocol for the service whose name is name. And if that service is just… not a thing anyone knows about? Then NULL comes back. ghosted, literally 😭
  • getservprotobyport() β€” same energy but you're coming in through the door with the standard port number port, and it gives you the appropriate protocol for that service. Service unknown? Yeah. NULL again. πŸ™ˆ

πŸŽ€ RETURN VALUE πŸŽ€

here's the tea: if a service is known to more than one protocol, then the one that gets returned is the most frequently used one. it's giving main character protocol, periodt πŸ‘‘


πŸ¦‹ NOTES πŸ¦‹

these functions use a lookup table that's compiled straight into the ZSock kernel β€” and ngl, it's not likely that method will change in the near future. it's iconic like that, no cap ⭐


🌈 AUTHOR 🌈

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


and that's a wrap, bestie πŸ“ this whole thing came to you from the z88dk Programmer's Manual, dated 18 February 2000 β€” yes she's vintage, yes she still slays πŸ’œπŸ§š

πŸ“¦ where this page comes from