Added function for accessing a specific neighbor

This commit is contained in:
adamdunkels 2007-11-26 23:30:13 +00:00
parent 4eae027dd3
commit 75be20bea6
2 changed files with 16 additions and 2 deletions

View file

@ -33,7 +33,7 @@
* *
* This file is part of the Contiki operating system. * 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; max_time = seconds;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int
neighbor_num(void)
{
return MAX_NEIGHBORS;
}
/*---------------------------------------------------------------------------*/
struct neighbor *
neighbor_get(int num)
{
return &neighbors[num];
}
/*---------------------------------------------------------------------------*/
/** @} */ /** @} */

View file

@ -38,7 +38,7 @@
* *
* This file is part of the Contiki operating system. * 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); uint8_t neighbor_etx(struct neighbor *n);
int neighbor_num(void);
struct neighbor *neighbor_get(int num);
#endif /* __NEIGHBOR_H__ */ #endif /* __NEIGHBOR_H__ */
/** @} */ /** @} */