… | |
… | |
294 | } |
294 | } |
295 | |
295 | |
296 | ############################################################################# |
296 | ############################################################################# |
297 | # node monitoring and info |
297 | # node monitoring and info |
298 | |
298 | |
299 | =item node_is_known $nodeid |
|
|
300 | |
|
|
301 | #TODO# |
|
|
302 | Returns true iff the given node is currently known to this node. |
|
|
303 | |
|
|
304 | =cut |
|
|
305 | |
|
|
306 | sub node_is_known($) { |
|
|
307 | exists $NODE{$_[0]} |
|
|
308 | } |
|
|
309 | |
|
|
310 | =item node_is_up $nodeid |
299 | =item node_is_up $nodeid |
311 | |
300 | |
312 | Returns true if the given node is "up", that is, the kernel thinks it has |
301 | Returns true if the given node is "up", that is, the kernel thinks it has |
313 | a working connection to it. |
302 | a working connection to it. |
314 | |
303 | |
315 | If the node is known (to this local node) but not currently connected, |
304 | If the node is up, returns C<1>. If the node is currently connecting or |
316 | returns C<0>. If the node is not known, returns C<undef>. |
305 | otherwise known but not connected, returns C<0>. If nothing is known about |
|
|
306 | the node, returns C<undef>. |
317 | |
307 | |
318 | =cut |
308 | =cut |
319 | |
309 | |
320 | sub node_is_up($) { |
310 | sub node_is_up($) { |
321 | ($NODE{$_[0]} or return)->{transport} |
311 | ($NODE{$_[0]} or return)->{transport} |