* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING. If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; see the file COPYING; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* RIPng support added by Vincent Jardin <vincent.jardin@6wind.com>
}
/* Update timeout thread. */
- peer->t_timeout = thread_add_timer(master, ripng_peer_timeout, peer,
- RIPNG_PEER_TIMER_DEFAULT);
+ peer->t_timeout = NULL;
+ thread_add_timer(master, ripng_peer_timeout, peer,
+ RIPNG_PEER_TIMER_DEFAULT, &peer->t_timeout);
/* Last update time set. */
time(&peer->uptime);
return peer;
}
-void ripng_peer_update(struct sockaddr_in6 *from, u_char version)
+void ripng_peer_update(struct sockaddr_in6 *from, uint8_t version)
{
struct ripng_peer *peer;
peer = ripng_peer_get(&from->sin6_addr);
uptime -= peer->uptime;
tm = gmtime(&uptime);
-/* Making formatted timer strings. */
-#define ONE_DAY_SECOND 60*60*24
-#define ONE_WEEK_SECOND 60*60*24*7
-
if (uptime < ONE_DAY_SECOND)
snprintf(buf, len, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
tm->tm_sec);
char timebuf[RIPNG_UPTIME_LEN];
for (ALL_LIST_ELEMENTS(peer_list, node, nnode, peer)) {
- vty_out(vty, " %s %s%14s %10d %10d %10d %s%s",
- inet6_ntoa(peer->addr), VTY_NEWLINE, " ",
- peer->recv_badpackets, peer->recv_badroutes,
- ZEBRA_RIPNG_DISTANCE_DEFAULT,
- ripng_peer_uptime(peer, timebuf, RIPNG_UPTIME_LEN),
- VTY_NEWLINE);
+ vty_out(vty, " %s \n%14s %10d %10d %10d %s\n",
+ inet6_ntoa(peer->addr), " ", peer->recv_badpackets,
+ peer->recv_badroutes, ZEBRA_RIPNG_DISTANCE_DEFAULT,
+ ripng_peer_uptime(peer, timebuf, RIPNG_UPTIME_LEN));
}
}
static int ripng_peer_list_cmp(struct ripng_peer *p1, struct ripng_peer *p2)
{
- return addr6_cmp(&p1->addr, &p2->addr) > 0;
+ return memcmp(&p1->addr, &p2->addr, sizeof(struct in6_addr));
}
void ripng_peer_init()