* zebra_vty.c: Unbreak "show ip route" command help and make it work
for isis routes.
+ * interface.c(if_dump_vty): Show IPv6 addresses in "show interface"
+ output. Fixes Bugzilla #119.
+ * *.c: Make some strings const and some (unsigned) casts to fix
+ compiler warnings.
2004-10-07 Hasso Tepper <hasso at quagga.net>
}
}
+ for (node = listhead (ifp->connected); node; nextnode (node))
+ {
+ connected = getdata (node);
+ if (CHECK_FLAG (connected->conf, ZEBRA_IFC_REAL) &&
+ (connected->address->family == AF_INET6))
+ connected_dump_vty (vty, connected);
+ }
+
#ifdef RTADV
nd_dump_vty (vty, ifp);
#endif /* RTADV */
"Bandwidth in kilobits\n")
\f
int
-ip_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
- char *peer_str, char *label)
+ip_address_install (struct vty *vty, struct interface *ifp,
+ const char *addr_str, const char *peer_str,
+ const char *label)
{
struct prefix_ipv4 cp;
struct connected *ifc;
}
int
-ip_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
- char *peer_str, char *label)
+ip_address_uninstall (struct vty *vty, struct interface *ifp,
+ const char *addr_str, const char *peer_str,
+ const char *label)
{
struct prefix_ipv4 cp;
struct connected *ifc;
#ifdef HAVE_IPV6
int
-ipv6_address_install (struct vty *vty, struct interface *ifp, char *addr_str,
- char *peer_str, char *label, int secondary)
+ipv6_address_install (struct vty *vty, struct interface *ifp,
+ const char *addr_str, const char *peer_str,
+ const char *label, int secondary)
{
struct prefix_ipv6 cp;
struct connected *ifc;
}
int
-ipv6_address_uninstall (struct vty *vty, struct interface *ifp, char *addr_str,
- char *peer_str, char *label, int secondry)
+ipv6_address_uninstall (struct vty *vty, struct interface *ifp,
+ const char *addr_str, const char *peer_str,
+ const char *label, int secondry)
{
struct prefix_ipv6 cp;
struct connected *ifc;
return 0;
}
-struct interface *get_iflist_ifp(int idx)
+struct interface *get_iflist_ifp(unsigned int idx)
{
struct listnode *node;
struct interface *ifp;
zi=ifp->info;
irdp=&zi->irdp;
- if( atoi(argv[0]) <= irdp->MaxAdvertInterval) {
+ if( (unsigned) atoi(argv[0]) <= irdp->MaxAdvertInterval) {
irdp->MinAdvertInterval = atoi(argv[0]);
return CMD_SUCCESS;
irdp=&zi->irdp;
- if( irdp->MinAdvertInterval <= atoi(argv[0]) ) {
+ if( irdp->MinAdvertInterval <= (unsigned) atoi(argv[0]) ) {
irdp->MaxAdvertInterval = atoi(argv[0]);
return CMD_SUCCESS;
void rib_init ();
int
-static_add_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
u_char flags, u_char distance, u_int32_t vrf_id);
int
-static_delete_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
u_char distance, u_int32_t vrf_id);
#ifdef HAVE_IPV6
int
static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
- char *ifname, u_char flags, u_char distance, u_int32_t vrf_id);
+ const char *ifname, u_char flags, u_char distance,
+ u_int32_t vrf_id);
int
static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
- char *ifname, u_char distance, u_int32_t vrf_id);
+ const char *ifname, u_char distance, u_int32_t vrf_id);
#endif /* HAVE_IPV6 */
/* Add static route into static route configuration. */
int
-static_add_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_add_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
u_char flags, u_char distance, u_int32_t vrf_id)
{
u_char type = 0;
/* Delete static route from static route configuration. */
int
-static_delete_ipv4 (struct prefix *p, struct in_addr *gate, char *ifname,
+static_delete_ipv4 (struct prefix *p, struct in_addr *gate, const char *ifname,
u_char distance, u_int32_t vrf_id)
{
u_char type = 0;
/* Add static route into static route configuration. */
int
static_add_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
- char *ifname, u_char flags, u_char distance, u_int32_t vrf_id)
+ const char *ifname, u_char flags, u_char distance,
+ u_int32_t vrf_id)
{
struct route_node *rn;
struct static_ipv6 *si;
/* Delete static route from static route configuration. */
int
static_delete_ipv6 (struct prefix *p, u_char type, struct in6_addr *gate,
- char *ifname, u_char distance, u_int32_t vrf_id)
+ const char *ifname, u_char distance, u_int32_t vrf_id)
{
struct route_node *rn;
struct static_ipv6 *si;
/* Short circuit exact matches of wrong length */
- if (exact && (*objid_len != v->namelen + 10))
+ if (exact && (*objid_len != (unsigned) v->namelen + 10))
return;
table = vrf_table (AFI_IP, SAFI_UNICAST, 0);
if (*objid_len > v->namelen)
oid2in_addr (objid + v->namelen, MIN(4, *objid_len - v->namelen), &dest);
- if (*objid_len > v->namelen + 4)
+ if (*objid_len > (unsigned) v->namelen + 4)
proto = objid[v->namelen + 4];
- if (*objid_len > v->namelen + 5)
+ if (*objid_len > (unsigned) v->namelen + 5)
policy = objid[v->namelen + 5];
- if (*objid_len > v->namelen + 6)
+ if (*objid_len > (unsigned) v->namelen + 6)
oid2in_addr (objid + v->namelen + 6, MIN(4, *objid_len - v->namelen - 6),
&nexthop);
/* Apply GETNEXT on not exact search */
- if (!exact && (*objid_len >= v->namelen + 10))
+ if (!exact && (*objid_len >= (unsigned) v->namelen + 10))
{
if (! in_addr_add((u_char *) &nexthop, 1))
return;
\f
/* General fucntion for static route. */
int
-zebra_static_ipv4 (struct vty *vty, int add_cmd,
- char *dest_str, char *mask_str, char *gate_str,
- char *flag_str, char *distance_str)
+zebra_static_ipv4 (struct vty *vty, int add_cmd, const char *dest_str,
+ const char *mask_str, const char *gate_str,
+ const char *flag_str, const char *distance_str)
{
int ret;
u_char distance;
struct prefix p;
struct in_addr gate;
struct in_addr mask;
- char *ifname;
+ const char *ifname;
u_char flag = 0;
ret = str2prefix (dest_str, &p);
}
}
-#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, > - selected route, * - FIB route%s%s"
+#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
+ "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
+ "> - selected route, * - FIB route%s%s"
DEFUN (show_ip_route,
show_ip_route_cmd,
#ifdef HAVE_IPV6
/* General fucntion for IPv6 static route. */
int
-static_ipv6_func (struct vty *vty, int add_cmd, char *dest_str,
- char *gate_str, char *ifname, char *flag_str, char *distance_str)
+static_ipv6_func (struct vty *vty, int add_cmd, const char *dest_str,
+ const char *gate_str, const char *ifname,
+ const char *flag_str, const char *distance_str)
{
int ret;
u_char distance;