From 75be20bea65d3aa95376bdd6dff07acd14af17db Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Mon, 26 Nov 2007 23:30:13 +0000 Subject: [PATCH] Added function for accessing a specific neighbor --- core/net/rime/neighbor.c | 14 +++++++++++++- core/net/rime/neighbor.h | 4 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/net/rime/neighbor.c b/core/net/rime/neighbor.c index 846930033..4996a3b46 100644 --- a/core/net/rime/neighbor.c +++ b/core/net/rime/neighbor.c @@ -33,7 +33,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor.c,v 1.11 2007/11/17 10:32:54 adamdunkels Exp $ + * $Id: neighbor.c,v 1.12 2007/11/26 23:30:13 adamdunkels Exp $ */ /** @@ -261,4 +261,16 @@ neighbor_set_lifetime(int seconds) max_time = seconds; } /*---------------------------------------------------------------------------*/ +int +neighbor_num(void) +{ + return MAX_NEIGHBORS; +} +/*---------------------------------------------------------------------------*/ +struct neighbor * +neighbor_get(int num) +{ + return &neighbors[num]; +} +/*---------------------------------------------------------------------------*/ /** @} */ diff --git a/core/net/rime/neighbor.h b/core/net/rime/neighbor.h index 602012392..70c54fe29 100644 --- a/core/net/rime/neighbor.h +++ b/core/net/rime/neighbor.h @@ -38,7 +38,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor.h,v 1.7 2007/11/17 10:32:54 adamdunkels Exp $ + * $Id: neighbor.h,v 1.8 2007/11/26 23:30:13 adamdunkels Exp $ */ /** @@ -78,6 +78,8 @@ void neighbor_set_lifetime(int seconds); uint8_t neighbor_etx(struct neighbor *n); +int neighbor_num(void); +struct neighbor *neighbor_get(int num); #endif /* __NEIGHBOR_H__ */ /** @} */