Skip to contentSkip to conversation

MONITOR: show IPv6 prefix list

PATCH New Masahide Nakamura 1 participant 1 message Jan 11, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MONITOR: show IPv6 prefix list

Hi,

This is also iproute2 patch, ipmonitor shows IPv6 prefix list notification from kernel (tested on 2.6.10). Please apply it.

The ChangeSet is also available at:
<bk://bk.skbuff.net:38000/iproute2-prefix/>

Regards,

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2005/01/11 12:45:13+09:00 [email protected]
# ipmonitor: show prefix information.
#

# ip/ipprefix.c
#   2005/01/11 12:45:12+09:00 [email protected] +107 -0
# 
# BitKeeper/etc/logging_ok
#   2005/01/11 12:45:13+09:00 [email protected] +1 -0
#   Logging to [email protected] accepted
# 
# ip/ipprefix.c
#   2005/01/11 12:45:12+09:00 [email protected] +0 -0
#   BitKeeper file /home/nakam/src/bk/iproute2-prefix/ip/ipprefix.c
# 
# ip/ipmonitor.c
#   2005/01/11 12:45:12+09:00 [email protected] +12 -0
#   support prefix information.
# 
# ip/ip_common.h
#   2005/01/11 12:45:12+09:00 [email protected] +2 -0
#   print prefix information.
# 
# ip/Makefile
#   2005/01/11 12:45:12+09:00 [email protected] +1 -1
#   add a file for prefix information.
# 
diff -Nru a/ip/Makefile b/ip/Makefile
--- a/ip/Makefile	Tue Jan 11 13:11:20 2005
+++ b/ip/Makefile	Tue Jan 11 13:11:20 2005
@@ -1,6 +1,6 @@
 IPOBJ=ip.o ipaddress.o iproute.o iprule.o \
     rtm_map.o iptunnel.o ipneigh.o iplink.o \
-    ipmaddr.o ipmonitor.o ipmroute.o \
+    ipmaddr.o ipmonitor.o ipmroute.o ipprefix.o \
     ipxfrm.o xfrm_state.o xfrm_policy.o

RTMONOBJ=rtmon.o

ip/ip_common.h +2 -0
diff -Nru a/ip/ip_common.h b/ip/ip_common.h
@@ -15,6 +15,8 @@
 extern void ipneigh_reset_filter(void);
 extern int print_route(const struct sockaddr_nl *who, 
 		       struct nlmsghdr *n, void *arg);
+extern int print_prefix(const struct sockaddr_nl *who,
+			struct nlmsghdr *n, void *arg);
 extern int do_ipaddr(int argc, char **argv);
 extern int do_iproute(int argc, char **argv);
 extern int do_iprule(int argc, char **argv);
ip/ipmonitor.c +12 -0
diff -Nru a/ip/ipmonitor.c b/ip/ipmonitor.c
@@ -55,6 +55,10 @@
 		print_neigh(who, n, arg);
 		return 0;
 	}
+	if (n->nlmsg_type == RTM_NEWPREFIX) {
+		print_prefix(who, n, arg);
+		return 0;
+	}
 	if (n->nlmsg_type == 15) {
 		char *tstr;
 		time_t secs = ((__u32*)NLMSG_DATA(n))[0];
@@ -87,6 +91,7 @@
 	int llink=0;
 	int laddr=0;
 	int lroute=0;
+	int lprefix=0;
 
 	ipaddr_reset_filter(1);
 	iproute_reset_filter();
@@ -105,6 +110,9 @@
 		} else if (matches(*argv, "route") == 0) {
 			lroute=1;
 			groups = 0;
+		} else if (matches(*argv, "prefix") == 0) {
+			lprefix=1;
+			groups = 0;
 		} else if (strcmp(*argv, "all") == 0) {
 			groups = ~RTMGRP_TC;
 		} else if (matches(*argv, "help") == 0) {
@@ -129,6 +137,10 @@
 			groups |= RTMGRP_IPV4_ROUTE;
 		if (!preferred_family || preferred_family == AF_INET6)
 			groups |= RTMGRP_IPV6_ROUTE;
+	}
+	if (lprefix) {
+		if (!preferred_family || preferred_family == AF_INET6)
+			groups |= RTMGRP_IPV6_PREFIX;
 	}
 
 	if (file) {
ip/ipprefix.c new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
Masahide NAKAMURA