GETNODEBYNAME(3)
π GETNODEBYNAME(3) π
okay bestie, welcome to the DECnet node entry retrieval by address page β it's a Library Functions Manual moment and honestly? iconic. pull up a chair, we're finding nodes by name and we're gonna slay it π¦
β¨ NAME β¨
getnodebyname β DECnet node entry retrieval by address π
πΈ SYNOPSIS πΈ
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
struct nodeent *getnodebyname (char *name)
like literally just hand it a name and it hands you back a struct nodeent *. no cap. π
π DESCRIPTION π
so here's the vibe: getnodebyname goes digging through the decnet hosts file looking for the DECnet node whose name equals name, and when it finds it, it drops all that node info right into the nodeent structure. bestie behavior fr fr π«Ά
and if there's no entry? it returns NULL. that's it. that's the whole thing. no drama, just NULL π
β EXAMPLE β
here's how you actually use it, watch and learn π§:
#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>
main(void)
{
struct nodeent *dp;
if ( (dp=getnodebyname("mv3100")) == NULL)
printf("Error, cannot find node entry");
else
printf("Node name is %s",dp->n_name);
}
look at mv3100 doing main character energy in there. and if it can't find it, we print "Error, cannot find node entry" β the saddest little printf π. otherwise we flex dp->n_name with "Node name is %s". periodt. π
π¦ SEE ALSO π¦
the whole friend group, together again, iykyk π
this one's brought to you by the DECnet database functions girlies, dated July 28, 1998 β an absolute vintage baddie, still serving after all these years. bye bestie, go find your nodes πβ¨π
π¦ 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