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

# dnet\_getnode(3)

Get nodes from DECnet database

## NAME

dnet\_getnode, dnet\_nextnode, dnet\_endnode - Get nodes from DECnet database

## SYNOPSIS

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

**void \*dnet\_getnode (void)**\
 **char \*dnet\_nextnode (void \*)**\
 **void dnet\_endnode (void \*)**

## DESCRIPTION

**dnet\_getnode()** Starts the search of the DECnet nodes database (/etc/decnet.conf). It returns an opaque pointer which is passed to the other two functions.\
 **dnet\_nextnode()** returns the next node name in the list. The pointer is private to the library and will be overwritten at the next dnet\_nextnode call. **dnet\_endnode()** ends the search. It must be called when you have finished  with this group of functions or a memory leak will result.

## EXAMPLE

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

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