---
name: "getnodebyaddr"
section: "3"
platform: "linux"
package: "libdnet-dev"
version: "2.65+b1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/getnodebyaddr"
---

# getnodebyaddr(3)

DECnet node entry retrieval by address

## 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

**getnodebyaddr** searches the decnet hosts file for the DECnet node with address equal to **addr** of **len** bytes, belonging to protocol family **family** (PF\_DECnet) and returns node information into the **nodeent** structure.\
 If no entry is found, returns  **NULL**

## EXAMPLE

```
#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);
}
```

## SEE ALSO

[**dnet\_htoa**(3)](/dnet_htoa/3.md), [**dnet\_ntoa**(3)](/dnet_ntoa/3.md), [**dnet\_conn**(3)](/dnet_conn/3.md), [**dnet\_addr**(3)](/dnet_addr/3.md), [**getnodebyname**(3)](/getnodebyname/3.md), [**getnodeadd**(3)](/getnodeadd/3.md), [**setnodeent**(3)](/setnodeent/3.md)
