mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 16:23:29 +00:00
No warnings here any more.
This commit is contained in:
parent
54ade99658
commit
1cd80845dc
@ -1,3 +1,11 @@
|
|||||||
|
2004-10-07 Hasso Tepper <hasso at quagga.net>
|
||||||
|
|
||||||
|
* *.[c|h]: Fix warnings: make strings const, signed -> unsigned,
|
||||||
|
remove or comment out unused variables etc.
|
||||||
|
* isis_lsp.c: Clean lsp_print_detail() a bit, add TE TLV's and
|
||||||
|
removed old code.
|
||||||
|
* isis_circuit.c: Remove old ip/ipv6 address commands code.
|
||||||
|
|
||||||
2004-10-03 Hasso Tepper <hasso at quagga.net>
|
2004-10-03 Hasso Tepper <hasso at quagga.net>
|
||||||
|
|
||||||
* isis_zebra.c: Read router id related messages from zebra daemon.
|
* isis_zebra.c: Read router id related messages from zebra daemon.
|
||||||
|
@ -170,7 +170,7 @@ isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb)
|
|||||||
|
|
||||||
void
|
void
|
||||||
isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state state,
|
isis_adj_state_change (struct isis_adjacency *adj, enum isis_adj_state state,
|
||||||
char *reason)
|
const char *reason)
|
||||||
{
|
{
|
||||||
int old_state;
|
int old_state;
|
||||||
int level = adj->level;
|
int level = adj->level;
|
||||||
|
@ -105,7 +105,7 @@ struct isis_adjacency *isis_new_adj (u_char * id, u_char * snpa, int level,
|
|||||||
struct isis_circuit *circuit);
|
struct isis_circuit *circuit);
|
||||||
void isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb);
|
void isis_delete_adj (struct isis_adjacency *adj, struct list *adjdb);
|
||||||
void isis_adj_state_change (struct isis_adjacency *adj,
|
void isis_adj_state_change (struct isis_adjacency *adj,
|
||||||
enum isis_adj_state state, char *reason);
|
enum isis_adj_state state, const char *reason);
|
||||||
void isis_adj_print (struct isis_adjacency *adj);
|
void isis_adj_print (struct isis_adjacency *adj);
|
||||||
int isis_adj_expire (struct thread *thread);
|
int isis_adj_expire (struct thread *thread);
|
||||||
void isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty);
|
void isis_adj_print_vty (struct isis_adjacency *adj, struct vty *vty);
|
||||||
|
@ -631,17 +631,10 @@ isis_interface_config_write (struct vty *vty)
|
|||||||
int write = 0;
|
int write = 0;
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct listnode *node2;
|
struct listnode *node2;
|
||||||
struct listnode *node3;
|
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
struct isis_area *area;
|
struct isis_area *area;
|
||||||
struct isis_circuit *c;
|
struct isis_circuit *c;
|
||||||
struct prefix_ipv4 *ip;
|
|
||||||
int i;
|
int i;
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
struct prefix_ipv6 *ipv6;
|
|
||||||
#endif /*HAVE_IPV6 */
|
|
||||||
|
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
LIST_LOOP (iflist, ifp, node)
|
LIST_LOOP (iflist, ifp, node)
|
||||||
{
|
{
|
||||||
@ -1718,122 +1711,6 @@ DEFUN (isis_hello,
|
|||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
DEFUN (ip_address,
|
|
||||||
ip_address_cmd,
|
|
||||||
"ip address A.B.C.D/A",
|
|
||||||
"Interface Internet Protocol config commands\n"
|
|
||||||
"Set the IP address of an interface\n" "IP address (e.g. 10.0.0.1/8\n")
|
|
||||||
{
|
|
||||||
struct interface *ifp;
|
|
||||||
struct isis_circuit *circuit;
|
|
||||||
struct prefix_ipv4 *ipv4, *ip;
|
|
||||||
struct listnode *node;
|
|
||||||
int ret, found = 1;
|
|
||||||
|
|
||||||
ifp = vty->index;
|
|
||||||
circuit = ifp->info;
|
|
||||||
if (circuit == NULL)
|
|
||||||
{
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
assert (circuit);
|
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
zlog_info ("ip_address_cmd circuit %d", circuit->interface->ifindex);
|
|
||||||
#endif /* HAVE_IPV6 */
|
|
||||||
|
|
||||||
ipv4 = prefix_ipv4_new ();
|
|
||||||
|
|
||||||
ret = str2prefix_ipv4 (argv[0], ipv4);
|
|
||||||
if (ret <= 0)
|
|
||||||
{
|
|
||||||
zlog_warn ("ip_address_cmd(): malformed address");
|
|
||||||
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!circuit->ip_addrs)
|
|
||||||
circuit->ip_addrs = list_new ();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (node = listhead (circuit->ip_addrs); node; nextnode (node))
|
|
||||||
{
|
|
||||||
ip = getdata (node);
|
|
||||||
if (prefix_same ((struct prefix *) ip, (struct prefix *) ipv4))
|
|
||||||
found = 1;
|
|
||||||
}
|
|
||||||
if (found)
|
|
||||||
{
|
|
||||||
prefix_ipv4_free (ipv4);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
listnode_add (circuit->ip_addrs, ipv4);
|
|
||||||
#ifdef EXTREME_DEBUG
|
|
||||||
zlog_info ("added IP address %s to circuit %d", argv[0],
|
|
||||||
circuit->interface->ifindex);
|
|
||||||
#endif /* EXTREME_DEBUG */
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_ip_address,
|
|
||||||
no_ip_address_cmd,
|
|
||||||
"no ip address A.B.C.D/A",
|
|
||||||
NO_STR
|
|
||||||
"Interface Internet Protocol config commands\n"
|
|
||||||
"Set the IP address of an interface\n"
|
|
||||||
"IP address (e.g. 10.0.0.1/8\n")
|
|
||||||
{
|
|
||||||
struct interface *ifp;
|
|
||||||
struct isis_circuit *circuit;
|
|
||||||
struct prefix_ipv4 ipv4, *ip = NULL;
|
|
||||||
struct listnode *node;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ifp = vty->index;
|
|
||||||
circuit = ifp->info;
|
|
||||||
/* UGLY - will remove l8r */
|
|
||||||
if (circuit == NULL)
|
|
||||||
{
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
assert (circuit);
|
|
||||||
|
|
||||||
if (!circuit->ip_addrs || circuit->ip_addrs->count == 0)
|
|
||||||
{
|
|
||||||
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
ret = str2prefix_ipv4 (argv[0], &ipv4);
|
|
||||||
if (ret <= 0)
|
|
||||||
{
|
|
||||||
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (node = listhead (circuit->ip_addrs); node; nextnode (node))
|
|
||||||
{
|
|
||||||
ip = getdata (node);
|
|
||||||
if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ip)
|
|
||||||
{
|
|
||||||
listnode_delete (circuit->ip_addrs, ip);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
DEFUN (no_isis_hello,
|
DEFUN (no_isis_hello,
|
||||||
no_isis_hello_cmd,
|
no_isis_hello_cmd,
|
||||||
"no isis hello padding",
|
"no isis hello padding",
|
||||||
@ -2137,130 +2014,6 @@ DEFUN (no_ipv6_router_isis,
|
|||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0 /* Guess we don't really need these */
|
|
||||||
|
|
||||||
DEFUN (ipv6_address,
|
|
||||||
ipv6_address_cmd,
|
|
||||||
"ipv6 address X:X::X:X/M",
|
|
||||||
"Interface Internet Protocol config commands\n"
|
|
||||||
"Set the IP address of an interface\n"
|
|
||||||
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
|
||||||
{
|
|
||||||
struct interface *ifp;
|
|
||||||
struct isis_circuit *circuit;
|
|
||||||
struct prefix_ipv6 *ipv6, *ip6;
|
|
||||||
struct listnode *node;
|
|
||||||
int ret, found = 1;
|
|
||||||
|
|
||||||
ifp = vty->index;
|
|
||||||
circuit = ifp->info;
|
|
||||||
/* UGLY - will remove l8r */
|
|
||||||
if (circuit == NULL)
|
|
||||||
{
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
assert (circuit);
|
|
||||||
#ifdef EXTREME_DEBUG
|
|
||||||
zlog_info ("ipv6_address_cmd circuit %d", circuit->idx);
|
|
||||||
#endif /* EXTREME_DEBUG */
|
|
||||||
|
|
||||||
if (circuit == NULL)
|
|
||||||
{
|
|
||||||
zlog_warn ("ipv6_address_cmd(): no circuit");
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ipv6 = prefix_ipv6_new ();
|
|
||||||
|
|
||||||
ret = str2prefix_ipv6 (argv[0], ipv6);
|
|
||||||
if (ret <= 0)
|
|
||||||
{
|
|
||||||
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!circuit->ipv6_addrs)
|
|
||||||
circuit->ipv6_addrs = list_new ();
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (node = listhead (circuit->ipv6_addrs); node; nextnode (node))
|
|
||||||
{
|
|
||||||
ip6 = getdata (node);
|
|
||||||
if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
|
|
||||||
found = 1;
|
|
||||||
}
|
|
||||||
if (found)
|
|
||||||
{
|
|
||||||
prefix_ipv6_free (ipv6);
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
listnode_add (circuit->ipv6_addrs, ipv6);
|
|
||||||
#ifdef EXTREME_DEBUG
|
|
||||||
zlog_info ("added IPv6 address %s to circuit %d", argv[0], circuit->idx);
|
|
||||||
#endif /* EXTREME_DEBUG */
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEFUN (no_ipv6_address,
|
|
||||||
no_ipv6_address_cmd,
|
|
||||||
"no ipv6 address X:X::X:X/M",
|
|
||||||
NO_STR
|
|
||||||
"Interface Internet Protocol config commands\n"
|
|
||||||
"Set the IP address of an interface\n"
|
|
||||||
"IPv6 address (e.g. 3ffe:506::1/48)\n")
|
|
||||||
{
|
|
||||||
struct interface *ifp;
|
|
||||||
struct isis_circuit *circuit;
|
|
||||||
struct prefix_ipv6 ipv6, *ip6 = NULL;
|
|
||||||
struct listnode *node;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ifp = vty->index;
|
|
||||||
circuit = ifp->info;
|
|
||||||
/* UGLY - will remove l8r */
|
|
||||||
if (circuit == NULL)
|
|
||||||
{
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
assert (circuit);
|
|
||||||
|
|
||||||
if (!circuit->ipv6_addrs || circuit->ipv6_addrs->count == 0)
|
|
||||||
{
|
|
||||||
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
ret = str2prefix_ipv6 (argv[0], &ipv6);
|
|
||||||
if (ret <= 0)
|
|
||||||
{
|
|
||||||
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
|
|
||||||
return CMD_WARNING;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (node = listhead (circuit->ipv6_addrs); node; nextnode (node))
|
|
||||||
{
|
|
||||||
ip6 = getdata (node);
|
|
||||||
if (prefix_same ((struct prefix *) ip6, (struct prefix *) &ipv6))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ip6)
|
|
||||||
{
|
|
||||||
listnode_delete (circuit->ipv6_addrs, ip6);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
|
||||||
}
|
|
||||||
#endif /* 0 */
|
|
||||||
#endif /* HAVE_IPV6 */
|
#endif /* HAVE_IPV6 */
|
||||||
|
|
||||||
struct cmd_node interface_node = {
|
struct cmd_node interface_node = {
|
||||||
@ -2348,10 +2101,6 @@ isis_circuit_init ()
|
|||||||
|
|
||||||
install_element (INTERFACE_NODE, &isis_hello_cmd);
|
install_element (INTERFACE_NODE, &isis_hello_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_isis_hello_cmd);
|
install_element (INTERFACE_NODE, &no_isis_hello_cmd);
|
||||||
#if 0
|
|
||||||
install_element (INTERFACE_NODE, &ip_address_cmd);
|
|
||||||
install_element (INTERFACE_NODE, &no_ip_address_cmd);
|
|
||||||
#endif
|
|
||||||
install_element (INTERFACE_NODE, &csnp_interval_cmd);
|
install_element (INTERFACE_NODE, &csnp_interval_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
|
install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
|
install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
|
||||||
@ -2365,9 +2114,5 @@ isis_circuit_init ()
|
|||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
|
install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
|
||||||
install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
|
install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
|
||||||
#if 0
|
|
||||||
install_element (INTERFACE_NODE, &ipv6_address_cmd);
|
|
||||||
install_element (INTERFACE_NODE, &no_ipv6_address_cmd);
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
|
|
||||||
extern struct isis *isis;
|
extern struct isis *isis;
|
||||||
|
|
||||||
static char *csm_statestr[] = {
|
static const char *csm_statestr[] = {
|
||||||
"C_STATE_NA",
|
"C_STATE_NA",
|
||||||
"C_STATE_INIT",
|
"C_STATE_INIT",
|
||||||
"C_STATE_CONF",
|
"C_STATE_CONF",
|
||||||
@ -61,7 +61,7 @@ static char *csm_statestr[] = {
|
|||||||
|
|
||||||
#define STATE2STR(S) csm_statestr[S]
|
#define STATE2STR(S) csm_statestr[S]
|
||||||
|
|
||||||
static char *csm_eventstr[] = {
|
static const char *csm_eventstr[] = {
|
||||||
"NO_STATE",
|
"NO_STATE",
|
||||||
"ISIS_ENABLE",
|
"ISIS_ENABLE",
|
||||||
"IF_UP_FROM_Z",
|
"IF_UP_FROM_Z",
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
extern struct isis *isis;
|
extern struct isis *isis;
|
||||||
extern struct thread_master *master;
|
extern struct thread_master *master;
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
isis_disflag2string (int disflag)
|
isis_disflag2string (int disflag)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ int isis_run_dr_l2 (struct thread *thread);
|
|||||||
int isis_dr_elect (struct isis_circuit *circuit, int level);
|
int isis_dr_elect (struct isis_circuit *circuit, int level);
|
||||||
int isis_dr_resign (struct isis_circuit *circuit, int level);
|
int isis_dr_resign (struct isis_circuit *circuit, int level);
|
||||||
int isis_dr_commence (struct isis_circuit *circuit, int level);
|
int isis_dr_commence (struct isis_circuit *circuit, int level);
|
||||||
char *isis_disflag2string (int disflag);
|
const char *isis_disflag2string (int disflag);
|
||||||
|
|
||||||
enum isis_dis_state
|
enum isis_dis_state
|
||||||
{
|
{
|
||||||
|
@ -317,7 +317,7 @@ isis_event_dis_status_change (struct thread *thread)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
isis_event_auth_failure (char *area_tag, char *error_string, u_char *sysid)
|
isis_event_auth_failure (char *area_tag, const char *error_string, u_char *sysid)
|
||||||
{
|
{
|
||||||
zlog_info ("ISIS-Evt (%s) Authentication failure %s from %s",
|
zlog_info ("ISIS-Evt (%s) Authentication failure %s from %s",
|
||||||
area_tag, error_string, sysid_print (sysid));
|
area_tag, error_string, sysid_print (sysid));
|
||||||
|
@ -49,7 +49,7 @@ int isis_event_dis_status_change (struct thread *thread);
|
|||||||
#define AUTH_ERROR_TYPE_LSP 3
|
#define AUTH_ERROR_TYPE_LSP 3
|
||||||
#define AUTH_ERROR_TYPE_SNP 2
|
#define AUTH_ERROR_TYPE_SNP 2
|
||||||
#define AUTH_ERROR_TYPE_HELLO 1
|
#define AUTH_ERROR_TYPE_HELLO 1
|
||||||
void isis_event_auth_failure (char *area_tag, char *error_string,
|
void isis_event_auth_failure (char *area_tag, const char *error_string,
|
||||||
u_char *sysid);
|
u_char *sysid);
|
||||||
|
|
||||||
#endif /* _ZEBRA_ISIS_EVENTS_H */
|
#endif /* _ZEBRA_ISIS_EVENTS_H */
|
||||||
|
171
isisd/isis_lsp.c
171
isisd/isis_lsp.c
@ -669,7 +669,7 @@ lspid_print (u_char * lsp_id, u_char * trg, char dynhost, char frag)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Convert the lsp attribute bits to attribute string */
|
/* Convert the lsp attribute bits to attribute string */
|
||||||
char *
|
const char *
|
||||||
lsp_bits2string (u_char * lsp_bits)
|
lsp_bits2string (u_char * lsp_bits)
|
||||||
{
|
{
|
||||||
char *pos = lsp_bits_string;
|
char *pos = lsp_bits_string;
|
||||||
@ -717,7 +717,6 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
|
|||||||
{
|
{
|
||||||
struct isis_lsp *lsp = dnode_get (node);
|
struct isis_lsp *lsp = dnode_get (node);
|
||||||
struct area_addr *area_addr;
|
struct area_addr *area_addr;
|
||||||
char nlpidstr[2];
|
|
||||||
int i;
|
int i;
|
||||||
struct listnode *lnode;
|
struct listnode *lnode;
|
||||||
struct is_neigh *is_neigh;
|
struct is_neigh *is_neigh;
|
||||||
@ -732,7 +731,6 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
|
|||||||
u_char LSPid[255];
|
u_char LSPid[255];
|
||||||
u_char hostname[255];
|
u_char hostname[255];
|
||||||
u_char buff[BUFSIZ];
|
u_char buff[BUFSIZ];
|
||||||
u_int32_t now, helper;
|
|
||||||
u_char ipv4_reach_prefix[20];
|
u_char ipv4_reach_prefix[20];
|
||||||
u_char ipv4_reach_mask[20];
|
u_char ipv4_reach_mask[20];
|
||||||
u_char ipv4_address[20];
|
u_char ipv4_address[20];
|
||||||
@ -788,6 +786,25 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TE router id */
|
||||||
|
if (lsp->tlv_data.router_id)
|
||||||
|
{
|
||||||
|
memcpy (ipv4_address, inet_ntoa (lsp->tlv_data.router_id->id),
|
||||||
|
sizeof (ipv4_address));
|
||||||
|
vty_out (vty, " Router ID: %s%s", ipv4_address, VTY_NEWLINE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* for the IS neighbor tlv */
|
||||||
|
if (lsp->tlv_data.is_neighs)
|
||||||
|
{
|
||||||
|
LIST_LOOP (lsp->tlv_data.is_neighs, is_neigh, lnode)
|
||||||
|
{
|
||||||
|
lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0);
|
||||||
|
vty_out (vty, " Metric: %d IS %s%s",
|
||||||
|
is_neigh->metrics.metric_default, LSPid, VTY_NEWLINE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* for the internal reachable tlv */
|
/* for the internal reachable tlv */
|
||||||
if (lsp->tlv_data.ipv4_int_reachs)
|
if (lsp->tlv_data.ipv4_int_reachs)
|
||||||
LIST_LOOP (lsp->tlv_data.ipv4_int_reachs, ipv4_reach, lnode)
|
LIST_LOOP (lsp->tlv_data.ipv4_int_reachs, ipv4_reach, lnode)
|
||||||
@ -814,17 +831,6 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
|
|||||||
ipv4_reach_mask, VTY_NEWLINE);
|
ipv4_reach_mask, VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for the IS neighbor tlv */
|
|
||||||
if (lsp->tlv_data.is_neighs)
|
|
||||||
{
|
|
||||||
LIST_LOOP (lsp->tlv_data.is_neighs, is_neigh, lnode)
|
|
||||||
{
|
|
||||||
lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0);
|
|
||||||
vty_out (vty, " Metric: %d IS %s%s",
|
|
||||||
is_neigh->metrics.metric_default, LSPid, VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* IPv6 tlv */
|
/* IPv6 tlv */
|
||||||
#ifdef HAVE_IPV6
|
#ifdef HAVE_IPV6
|
||||||
if (lsp->tlv_data.ipv6_reachs)
|
if (lsp->tlv_data.ipv6_reachs)
|
||||||
@ -845,145 +851,28 @@ lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
|
|||||||
buff, ipv6_reach->prefix_len, VTY_NEWLINE);
|
buff, ipv6_reach->prefix_len, VTY_NEWLINE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
/* TE IS neighbor tlv */
|
||||||
/* FIXME: Other tlvs such as te or external tlv will be added later */
|
|
||||||
#if 0
|
|
||||||
vty_out (vty, "%s %s %c%s",
|
|
||||||
VTY_NEWLINE, LSPid, lsp->own_lsp ? '*' : ' ', VTY_NEWLINE);
|
|
||||||
|
|
||||||
vty_out (vty, " Sequence: 0x%08x Checksum: 0x%04x Lifetime: ",
|
|
||||||
ntohl (lsp->lsp_header->seq_num),
|
|
||||||
ntohs (lsp->lsp_header->checksum));
|
|
||||||
|
|
||||||
if (ntohs (lsp->lsp_header->rem_lifetime) == 0)
|
|
||||||
vty_out (vty, " (%2u) ", lsp->age_out);
|
|
||||||
else
|
|
||||||
vty_out (vty, "%5u ", ntohs (lsp->lsp_header->rem_lifetime));
|
|
||||||
|
|
||||||
vty_out (vty, "%s Attributes:%s",
|
|
||||||
VTY_NEWLINE, lsp_bits2string (&lsp->lsp_header->lsp_bits));
|
|
||||||
|
|
||||||
/* if this is a self originated LSP then print
|
|
||||||
* the generation time plus when we sent it last
|
|
||||||
* if it is a non self-originated LSP then print the
|
|
||||||
* time when the LSP has been installed
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (lsp->own_lsp)
|
|
||||||
{
|
|
||||||
|
|
||||||
now = time (NULL);
|
|
||||||
helper = now - lsp->last_generated;
|
|
||||||
if (!lsp->last_generated)
|
|
||||||
helper = 0;
|
|
||||||
|
|
||||||
vty_out (vty, ", Generated: %s ago", time2string (helper));
|
|
||||||
|
|
||||||
now = time (NULL);
|
|
||||||
helper = now - lsp->last_sent;
|
|
||||||
if (!lsp->last_sent)
|
|
||||||
helper = 0;
|
|
||||||
|
|
||||||
vty_out (vty, ", Last sent: %s ago", time2string (helper));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
now = time (NULL);
|
|
||||||
helper = now - lsp->installed;
|
|
||||||
if (!lsp->installed)
|
|
||||||
helper = 0;
|
|
||||||
|
|
||||||
vty_out (vty, ", Installed: %s ago", time2string (helper));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
vty_out (vty, "%s", VTY_NEWLINE);
|
|
||||||
|
|
||||||
if (lsp->tlv_data.nlpids)
|
|
||||||
{
|
|
||||||
vty_out (vty, " Speaks: %s%s", nlpid2string (lsp->tlv_data.nlpids),
|
|
||||||
VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lsp->tlv_data.router_id)
|
|
||||||
{
|
|
||||||
vty_out (vty, " Router ID: %s%s",
|
|
||||||
inet_ntoa (lsp->tlv_data.router_id->id), VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lsp->tlv_data.is_neighs)
|
|
||||||
LIST_LOOP (lsp->tlv_data.is_neighs, is_neigh, lnode)
|
|
||||||
{
|
|
||||||
lspid_print (is_neigh->neigh_id, LSPid, dynhost, 0);
|
|
||||||
vty_out (vty, " IS %s, Metric: %d%s",
|
|
||||||
LSPid, is_neigh->metrics.metric_default, VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lsp->tlv_data.te_is_neighs)
|
if (lsp->tlv_data.te_is_neighs)
|
||||||
LIST_LOOP (lsp->tlv_data.te_is_neighs, te_is_neigh, lnode)
|
LIST_LOOP (lsp->tlv_data.te_is_neighs, te_is_neigh, lnode)
|
||||||
{
|
{
|
||||||
/* FIXME: metric display is wrong */
|
/* FIXME: metric display is wrong. */
|
||||||
lspid_print (te_is_neigh->neigh_id, LSPid, dynhost, 0);
|
lspid_print (te_is_neigh->neigh_id, LSPid, dynhost, 0);
|
||||||
vty_out (vty, " extd-IS %s, Metric: %d%s",
|
vty_out (vty, " Metric: %d extd-IS %s%s",
|
||||||
LSPid, te_is_neigh->te_metric[0], VTY_NEWLINE);
|
te_is_neigh->te_metric[0], LSPid, VTY_NEWLINE);
|
||||||
}
|
|
||||||
|
|
||||||
if (lsp->tlv_data.ipv4_int_reachs)
|
|
||||||
LIST_LOOP (lsp->tlv_data.ipv4_int_reachs, ipv4_reach, lnode)
|
|
||||||
{
|
|
||||||
vty_out (vty, " int-IP %s/%d, Metric: %d%s",
|
|
||||||
inet_ntoa (ipv4_reach->prefix),
|
|
||||||
ip_masklen (ipv4_reach->mask),
|
|
||||||
ipv4_reach->metrics.metric_default, VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lsp->tlv_data.ipv4_ext_reachs)
|
|
||||||
LIST_LOOP (lsp->tlv_data.ipv4_ext_reachs, ipv4_reach, lnode)
|
|
||||||
{
|
|
||||||
vty_out (vty, " ext-IP %s/%d, Metric: %d%s",
|
|
||||||
inet_ntoa (ipv4_reach->prefix),
|
|
||||||
ip_masklen (ipv4_reach->mask),
|
|
||||||
ipv4_reach->metrics.metric_default, VTY_NEWLINE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* TE IPv4 tlv */
|
||||||
if (lsp->tlv_data.te_ipv4_reachs)
|
if (lsp->tlv_data.te_ipv4_reachs)
|
||||||
LIST_LOOP (lsp->tlv_data.te_ipv4_reachs, te_ipv4_reach, lnode)
|
LIST_LOOP (lsp->tlv_data.te_ipv4_reachs, te_ipv4_reach, lnode)
|
||||||
{
|
{
|
||||||
vty_out (vty, " extd-IP %s/%d, Metric: %d%s",
|
/* FIXME: There should be better way to output this stuff. */
|
||||||
|
vty_out (vty, " Metric: %d extrd-IP %s/%d%s",
|
||||||
|
ntohl (te_ipv4_reach->te_metric),
|
||||||
inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start,
|
inet_ntoa (newprefix2inaddr (&te_ipv4_reach->prefix_start,
|
||||||
te_ipv4_reach->control)),
|
te_ipv4_reach->control)),
|
||||||
te_ipv4_reach->control & 0x3F,
|
te_ipv4_reach->control & 0x3F, VTY_NEWLINE);
|
||||||
ntohl (te_ipv4_reach->te_metric), VTY_NEWLINE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_IPV6
|
|
||||||
if (lsp->tlv_data.ipv6_reachs)
|
|
||||||
LIST_LOOP (lsp->tlv_data.ipv6_reachs, ipv6_reach, lnode)
|
|
||||||
{
|
|
||||||
memcpy (in6.s6_addr, ipv6_reach->prefix, 16);
|
|
||||||
inet_ntop (AF_INET6, &in6, buff, BUFSIZ);
|
|
||||||
if ((ipv6_reach->control_info &&
|
|
||||||
CTRL_INFO_DISTRIBUTION) == DISTRIBUTION_INTERNAL)
|
|
||||||
vty_out (vty, " int-IPv6 %s/%d, Metric: %d%s",
|
|
||||||
buff,
|
|
||||||
ipv6_reach->prefix_len,
|
|
||||||
ntohl (ipv6_reach->metric), VTY_NEWLINE);
|
|
||||||
else
|
|
||||||
vty_out (vty, " ext-IPv6 %s/%d, Metric: %d%s",
|
|
||||||
buff,
|
|
||||||
ipv6_reach->prefix_len,
|
|
||||||
ntohl (ipv6_reach->metric), VTY_NEWLINE);
|
|
||||||
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (lsp->tlv_data.hostname)
|
|
||||||
{
|
|
||||||
memset (hostname, 0, sizeof (hostname));
|
|
||||||
memcpy (hostname, lsp->tlv_data.hostname->name,
|
|
||||||
lsp->tlv_data.hostname->namelen);
|
|
||||||
vty_out (vty, " Hostname: %s%s", hostname, VTY_NEWLINE);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1453,8 +1342,6 @@ lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
|
|||||||
*/
|
*/
|
||||||
if (router_id_zebra.s_addr != 0)
|
if (router_id_zebra.s_addr != 0)
|
||||||
{
|
{
|
||||||
u_char value[4];
|
|
||||||
|
|
||||||
if (lsp->tlv_data.ipv4_addrs == NULL)
|
if (lsp->tlv_data.ipv4_addrs == NULL)
|
||||||
lsp->tlv_data.ipv4_addrs = list_new ();
|
lsp->tlv_data.ipv4_addrs = list_new ();
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ void lsp_update (struct isis_lsp *lsp, struct isis_link_state_hdr *lsp_hdr,
|
|||||||
void lsp_inc_seqnum (struct isis_lsp *lsp, u_int32_t seq_num);
|
void lsp_inc_seqnum (struct isis_lsp *lsp, u_int32_t seq_num);
|
||||||
int lsp_print_all (struct vty *vty, dict_t * lspdb, char detail,
|
int lsp_print_all (struct vty *vty, dict_t * lspdb, char detail,
|
||||||
char dynhost);
|
char dynhost);
|
||||||
char *lsp_bits2string (u_char *);
|
const char *lsp_bits2string (u_char *);
|
||||||
|
|
||||||
#ifdef TOPOLOGY_GENERATE
|
#ifdef TOPOLOGY_GENERATE
|
||||||
void generate_topology_lsps (struct isis_area *area);
|
void generate_topology_lsps (struct isis_area *area);
|
||||||
|
@ -96,7 +96,7 @@ int daemon_mode = 0;
|
|||||||
struct thread_master *master;
|
struct thread_master *master;
|
||||||
|
|
||||||
/* Process ID saved for use by init system */
|
/* Process ID saved for use by init system */
|
||||||
char *pid_file = PATH_ISISD_PID;
|
const char *pid_file = PATH_ISISD_PID;
|
||||||
|
|
||||||
/* for reload */
|
/* for reload */
|
||||||
char _cwd[MAXPATHLEN];
|
char _cwd[MAXPATHLEN];
|
||||||
|
@ -64,7 +64,7 @@ char nlpidstring[30];
|
|||||||
/*
|
/*
|
||||||
* This converts the isonet to its printable format
|
* This converts the isonet to its printable format
|
||||||
*/
|
*/
|
||||||
char *
|
const char *
|
||||||
isonet_print (u_char * from, int len)
|
isonet_print (u_char * from, int len)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -335,7 +335,7 @@ syst2string (int type)
|
|||||||
/*
|
/*
|
||||||
* Print functions - we print to static vars
|
* Print functions - we print to static vars
|
||||||
*/
|
*/
|
||||||
char *
|
const char *
|
||||||
snpa_print (u_char * from)
|
snpa_print (u_char * from)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -367,7 +367,7 @@ snpa_print (u_char * from)
|
|||||||
return snpa;
|
return snpa;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
sysid_print (u_char * from)
|
sysid_print (u_char * from)
|
||||||
{
|
{
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@ -399,7 +399,7 @@ sysid_print (u_char * from)
|
|||||||
return sysid;
|
return sysid;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
rawlspid_print (u_char * from)
|
rawlspid_print (u_char * from)
|
||||||
{
|
{
|
||||||
char *pos = lspid;
|
char *pos = lspid;
|
||||||
@ -417,7 +417,7 @@ rawlspid_print (u_char * from)
|
|||||||
return lspid;
|
return lspid;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
time2string (u_int32_t time)
|
time2string (u_int32_t time)
|
||||||
{
|
{
|
||||||
char *pos = datestring;
|
char *pos = datestring;
|
||||||
|
@ -40,11 +40,11 @@ int sysid2buff (u_char *, u_char *);
|
|||||||
/*
|
/*
|
||||||
* Printing functions
|
* Printing functions
|
||||||
*/
|
*/
|
||||||
char *isonet_print (u_char *, int len);
|
const char *isonet_print (u_char *, int len);
|
||||||
char *sysid_print (u_char *);
|
const char *sysid_print (u_char *);
|
||||||
char *snpa_print (u_char *);
|
const char *snpa_print (u_char *);
|
||||||
char *rawlspid_print (u_char *);
|
const char *rawlspid_print (u_char *);
|
||||||
char *time2string (u_int32_t);
|
const char *time2string (u_int32_t);
|
||||||
/* typedef struct nlpids nlpids; */
|
/* typedef struct nlpids nlpids; */
|
||||||
char *nlpid2string (struct nlpids *);
|
char *nlpid2string (struct nlpids *);
|
||||||
|
|
||||||
|
@ -1270,7 +1270,10 @@ process_snp (int snp_type, int level, struct isis_circuit *circuit,
|
|||||||
struct listnode *node, *node2;
|
struct listnode *node, *node2;
|
||||||
struct tlvs tlvs;
|
struct tlvs tlvs;
|
||||||
struct list *lsp_list = NULL;
|
struct list *lsp_list = NULL;
|
||||||
|
/* TODO: Implement SNP authentication. */
|
||||||
|
#if 0
|
||||||
struct isis_passwd *passwd;
|
struct isis_passwd *passwd;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (snp_type == ISIS_SNP_CSNP_FLAG)
|
if (snp_type == ISIS_SNP_CSNP_FLAG)
|
||||||
{
|
{
|
||||||
|
@ -174,7 +174,7 @@ vtype2string (enum vertextype vtype)
|
|||||||
return NULL; /* Not reached */
|
return NULL; /* Not reached */
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
const char *
|
||||||
vid2string (struct isis_vertex *vertex, u_char * buff)
|
vid2string (struct isis_vertex *vertex, u_char * buff)
|
||||||
{
|
{
|
||||||
switch (vertex->type)
|
switch (vertex->type)
|
||||||
@ -650,7 +650,7 @@ lspfragloop:
|
|||||||
if (fragnode == NULL)
|
if (fragnode == NULL)
|
||||||
fragnode = listhead (lsp->lspu.frags);
|
fragnode = listhead (lsp->lspu.frags);
|
||||||
else
|
else
|
||||||
fragnode = nextnode (fragnode);
|
nextnode (fragnode);
|
||||||
|
|
||||||
if (fragnode)
|
if (fragnode)
|
||||||
{
|
{
|
||||||
@ -703,7 +703,7 @@ pseudofragloop:
|
|||||||
if (fragnode == NULL)
|
if (fragnode == NULL)
|
||||||
fragnode = listhead (lsp->lspu.frags);
|
fragnode = listhead (lsp->lspu.frags);
|
||||||
else
|
else
|
||||||
fragnode = nextnode (fragnode);
|
nextnode (fragnode);
|
||||||
|
|
||||||
if (fragnode)
|
if (fragnode)
|
||||||
{
|
{
|
||||||
@ -800,7 +800,7 @@ isis_spf_preload_tent (struct isis_spftree *spftree,
|
|||||||
adj = getdata (anode);
|
adj = getdata (anode);
|
||||||
if (!speaks (&adj->nlpids, family))
|
if (!speaks (&adj->nlpids, family))
|
||||||
{
|
{
|
||||||
anode = nextnode (anode);
|
nextnode (anode);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
switch (adj->sys_type)
|
switch (adj->sys_type)
|
||||||
@ -834,7 +834,7 @@ isis_spf_preload_tent (struct isis_spftree *spftree,
|
|||||||
default:
|
default:
|
||||||
zlog_warn ("isis_spf_preload_tent unknow adj type");
|
zlog_warn ("isis_spf_preload_tent unknow adj type");
|
||||||
}
|
}
|
||||||
anode = nextnode (anode);
|
nextnode (anode);
|
||||||
}
|
}
|
||||||
list_delete (adj_list);
|
list_delete (adj_list);
|
||||||
/*
|
/*
|
||||||
|
@ -498,9 +498,7 @@ parse_tlvs (char *areatag, u_char * stream, int size, u_int32_t * expected,
|
|||||||
zlog_info ("ISIS-TLV (%s): TE Router ID %d", areatag, length);
|
zlog_info ("ISIS-TLV (%s): TE Router ID %d", areatag, length);
|
||||||
#endif /* EXTREME_TLV_DEBUG */
|
#endif /* EXTREME_TLV_DEBUG */
|
||||||
if (*expected & TLVFLAG_TE_ROUTER_ID)
|
if (*expected & TLVFLAG_TE_ROUTER_ID)
|
||||||
{
|
|
||||||
tlvs->router_id = (struct te_router_id *) (pnt);
|
tlvs->router_id = (struct te_router_id *) (pnt);
|
||||||
}
|
|
||||||
pnt += length;
|
pnt += length;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -753,7 +751,7 @@ int
|
|||||||
add_tlv (u_char tag, u_char len, u_char * value, struct stream *stream)
|
add_tlv (u_char tag, u_char len, u_char * value, struct stream *stream)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (STREAM_SIZE (stream) - stream_get_putp (stream) < len + 2)
|
if (STREAM_SIZE (stream) - stream_get_putp (stream) < (unsigned) len + 2)
|
||||||
{
|
{
|
||||||
zlog_warn ("No room for TLV of type %d", tag);
|
zlog_warn ("No room for TLV of type %d", tag);
|
||||||
return ISIS_WARNING;
|
return ISIS_WARNING;
|
||||||
|
@ -51,7 +51,6 @@ isis_router_id_update_zebra (int command, struct zclient *zclient,
|
|||||||
zebra_size_t length)
|
zebra_size_t length)
|
||||||
{
|
{
|
||||||
struct prefix router_id;
|
struct prefix router_id;
|
||||||
char buf[BUFSIZ];
|
|
||||||
|
|
||||||
zebra_router_id_update_read (zclient->ibuf,&router_id);
|
zebra_router_id_update_read (zclient->ibuf,&router_id);
|
||||||
router_id_zebra = router_id.u.prefix4;
|
router_id_zebra = router_id.u.prefix4;
|
||||||
@ -202,8 +201,10 @@ isis_zebra_if_address_del (int command, struct zclient *client,
|
|||||||
{
|
{
|
||||||
struct connected *c;
|
struct connected *c;
|
||||||
struct interface *ifp;
|
struct interface *ifp;
|
||||||
|
#ifdef EXTREME_DEBUG
|
||||||
struct prefix *p;
|
struct prefix *p;
|
||||||
u_char buf[BUFSIZ];
|
u_char buf[BUFSIZ];
|
||||||
|
#endif /* EXTREME_DEBUG */
|
||||||
|
|
||||||
c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
|
c = zebra_interface_address_read (ZEBRA_INTERFACE_ADDRESS_DELETE,
|
||||||
zclient->ibuf);
|
zclient->ibuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user