DNET_HTOA(3)

πŸ“¦ version 2.65build2, in ubuntu jammy

πŸ’– DNET_HTOA β€” ok bestie, let's talk πŸ’–

soooo this is dnet_htoa(3), a lil library function from the Library Functions Manual, and honestly? it's giving translator energy. it takes a DECnet address and goes "oh hey, that's a node, and its name is…" πŸ¦‹


✨ NAME ✨

dnet_htoa β€” DECnet address to host name translation. that's it, that's the job, no cap πŸ’…


✨ SYNOPSIS ✨

#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>

char *dnet_htoa (struct dn_naddr *addr)

✨ DESCRIPTION ✨

ok so dnet_htoa goes and searches the decnet hosts file for addr, and then hands you back the DECnet node name. iconic behaviour fr fr 🌸

and if it doesn't find an entry? no drama, no crash β€” it just returns the ascii DECnet address in the format area.node (like 1.1, 1.2, etc). lowkey a fallback queen πŸ‘‘


✨ EXAMPLE ✨

here's the whole thing in action, verbatim, don't touch it πŸŽ€

#include <netdnet/dn.h>
#include <netdnet/dnetdb.h>
#include <sys/socket.h>

main(void)
{
    struct dn_naddr          binaddr;

    binaddr.a_len  = 2;
    binaddr.a_addr[0]   = 0x02;
    binaddr.a_addr[1]   = 0x04;

    printf ("DECnet node name is %s",dnet_htoa(binaddr));

}

like. she's setting up a struct dn_naddr, a_len is 2, a_addr[0] is 0x02, a_addr[1] is 0x04, and then boom β€” printf prints the node name. main character energy tbh ⭐


✨ SEE ALSO ✨

go read these next, they're all in the same friend group 🫢


and that's the whole page bestie!! this one's from the DECnet database functions era, version dated July 28, 1998 β€” yes she's vintage, yes she still slays πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from