DNET_GETNODE(3)
π DNET_GETNODE π
okay bestie, welcome to the dnet_getnode manual page β it's a section 3 library function, part of the Library Functions Manual, and it's literally your all-access pass to the DECnet nodes database. let's go π¦
β¨ NAME β¨
dnet_getnode, dnet_nextnode, dnet_endnode β get nodes from the DECnet database π«Ά
πΈ SYNOPSIS πΈ
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
void *dnet_getnode (void)
char *dnet_nextnode (void *)
void dnet_endnode (void *)
π DESCRIPTION π
okay so here's the trio, and they work as a little group chat, no cap:
dnet_getnode()β starts the search of the DECnet nodes database, which lives at/etc/decnet.conf. it hands you back an opaque pointer, and that pointer is the thing you pass to the other two functions. main character energy fr πdnet_nextnode()β returns the next node name in the list. heads up though: that pointer is private to the library and it will be overwritten on the nextdnet_nextnodecall. so don't go holding onto it, bestie πdnet_endnode()β ends the search. it must be called when you're done with this group of functions, or you get a memory leak. not a vibe. not iconic. call it. periodt π
π EXAMPLE π
here's the whole thing looking cute and doing its little loop:
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>
main(void)
{
void *nodelist;
char *nodename;
nodelist = dnet_getnode();
nodename = dnet_nextnode(nodelist);
while(nodename)
{
printf("Found node %s\n", nodename);
nodename = dnet_nextnode(nodelist);
}
dnet_endnode(nodelist);
}
see how it grabs the list, walks it until nodename goes falsy, and then actually calls dnet_endnode? that last line is the glow-up π
π₯ SEE ALSO π₯
dnet_addr(3)dnet_ntoa(3)dnet_conn(3)getnodeadd(3)getnodebyname(3)getnodebyaddr(3)setnodeent(3)
that's the whole page, bestie β DECnet database functions, from way back on April 3, 1999, page DNET_GETNODE(3). slay πβ¨
π¦ 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