getrent

Langue: en

Version: 58928 (mandriva - 22/10/07)

Section: 2 (Appels système)

NAME

getrent, getrentc, getroute, getroute2, getrtype - Get LAM route information.

C SYNOPSIS

 #include <net.h>
 #include <rreq.h>
 #include <events.h>
 
 int getrent (struct route *rent);
 int getrentc (struct route *rent);
 int getroute (struct nmsg *nhead);
 int getroute2 (struct nmsg *nhead);
 int getrtype (int nodeid);
 

FORTRAN SYNOPSIS

 integer function IGRTP (nodeid)
 integer nodeid
 

DESCRIPTION

These functions return information obtained from the local route daemon, a modular component of the LAM daemon. getrent() and getrentc() accept a pointer to a route structure, defined in <rreq.h>:
 
      struct route {
           int  r_nodeid;
           int  r_event;
           int  r_link;
           int  r_event2;
           int  r_link2;
           int  r_nodetype;
      };
 

The structure fields hold the following information.

r_nodeid
destination node ID
r_event
forwarding event, representing the best suggested route to the destination node
r_link
forwarding link associated with r_event, if r_event is a datalink output process
r_event2
secondary forwarding event, representing a non-reconvergent route (primarily used for multicasting) with respect to other destinations
r_link2
forwarding link associated with r_event2, if r_event2 is a datalink output process
r_nodetype
node type of destination node (see getntype(2))

getrent() sends a request for route information to the route daemon. The r_nodeid field must be set by the caller to the nodeid of the destination node whose route table entry is required. All other fields are filled by the function.

getrentc() has the exact functionality of getrent(), except that it caches the recently accessed route table entries. Later access to the same entries are faster. getrentc() first checks the cache for the route entry of the given nodeid. If the entry is found, the requested information is returned. Otherwise, getrent() is called, returning a copy of the route table entry from the route daemon. This entry is then stored in the cache.

The remaining functions are wrappers for getrentc(). getroute() accepts a network message descriptor with the destination node and event fields set and fills in the forwarding fields. getroute2() is similar to getroute() except that the secondary routing information is used.

getrtype() accepts a node identifier and returns the type of that node.

C RETURN VALUE

Upon successful completion of getrent(), getrentc(), getroute(), or getroute2(), 0 is returned. Otherwise, -1 is returned and global error variable errno is set accordingly. getrtype() returns a valid node type when successful. NOTNODETYPE (defined in <net.h>) is returned if an error occurs. When an error occurs, these functions set the global variable errno to the appropriate error code.

FORTRAN RETURN VALUE

IGRTP() returns a valid node type when successful. NOTNODETYPE (see CONSTANTS(5)) is returned if an error occurs.

ERRORS

EBADNODE
The supplied node identifier does not exist.

SEE ALSO

getntype(2), rrsetrents(2), CONSTANTS(5)