GETNODEBYADDR(3)
π GETNODEBYADDR(3) π
okay bestie, welcome to the DECnet corner of the manual β this one lives in section 3 of the Library Functions Manual, and it's all about looking up a DECnet node when all you've got is its address. no cap, it's a little bop. π¦
β¨ NAME β¨
getnodebyaddr β DECnet node entry retrieval by address π
πΈ SYNOPSIS πΈ
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
struct nodeent *getnodebyaddr (char *addr, short len, const int family)
π DESCRIPTION π
so getnodebyaddr goes digging through the decnet hosts file looking for the DECnet node whose address equals addr and is len bytes long, belonging to protocol family family (that's PF_DECnet, babes). when it finds the one, it hands you back the node info all cozy inside the nodeent structure. π
and if there's literally no entry matching? it returns NULL. that's it. that's the whole vibe check. π
π₯ EXAMPLE π₯
here's how the girlies actually call it:
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>
main(void)
{
struct dn_naddr binaddr;
struct nodeent *dp;
binaddr->a_len = 2;
binaddr->a_addr[0] = 0x02;
binaddr->a_addr[1] = 0x04;
if ( (dp=getnodebyaddr(binaddr->a_addr,binaddr->len, PF_DECnet)) == NULL)
printf("Error, cannot find node entry");
else
printf("Node name is %s",dp->n_name);
}
like, if it comes back NULL you print the error, and if it doesn't you get the node name. main character energy fr fr. β¨
π«Ά SEE ALSO π«Ά
DECnet database functions π July 28, 1998 β yeah she's vintage, she's from the DECnet database functions era, and honestly? iconic. mwah π go look up some nodes bestie π
π¦ where this page comes from
- ubuntu jammy: libdnet-dev 2.65build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms