diff --git a/core/net/neighbor-info.c b/core/net/neighbor-info.c index f39802f0d..334542a84 100644 --- a/core/net/neighbor-info.c +++ b/core/net/neighbor-info.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor-info.c,v 1.12 2010/10/21 19:46:21 nvt-se Exp $ + * $Id: neighbor-info.c,v 1.13 2010/10/22 11:34:24 joxe Exp $ */ /** * \file @@ -164,3 +164,11 @@ neighbor_info_subscribe(neighbor_info_subscriber_t s) return 0; } /*---------------------------------------------------------------------------*/ +uint8_t +neighbor_info_get_etx(const rimeaddr_t *addr) +{ + uint8_t *etxp; + etxp = (uint8_t *)neighbor_attr_get_data(&etx, addr); + return etxp == NULL ? 0 : etxp; +} +/*---------------------------------------------------------------------------*/ diff --git a/core/net/neighbor-info.h b/core/net/neighbor-info.h index e01c15125..9ab7822aa 100644 --- a/core/net/neighbor-info.h +++ b/core/net/neighbor-info.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: neighbor-info.h,v 1.2 2010/03/12 13:40:13 nvt-se Exp $ + * $Id: neighbor-info.h,v 1.3 2010/10/22 11:34:24 joxe Exp $ */ /** * \file @@ -70,4 +70,12 @@ void neighbor_info_packet_received(void); */ int neighbor_info_subscribe(neighbor_info_subscriber_t); + +/** + * Get link ETX value for a specific neighbor. + * + * \return Returns ETX if the neighbor exists, and 0 if not. + */ +uint8_t neighbor_info_get_etx(const rimeaddr_t *addr); + #endif /* NEIGHBOR_INFO_H */