dnet_endnode(3)

dnet_endnode3

Get nodes from decnet database

Part of dnet_getnode(3).

Usage

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

void *dnet_getnode (void)
char *dnet_nextnode (void *)
void dnet_endnode (void *)

Overview

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.

Examples

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

Releases

9 releases since Debian 3.0 (Woody); the text changed 2 times.

  1. 3.0
  2. 3.1–4.0
  3. 5.0–10

From libdnet-dev 2.65+b1 in Debian 10 (Buster). Parsed by carta from the page's man source.