functions and some tiny related fixes. No functional changes.
+2005-01-18 Hasso Tepper <hasso at quagga.net>
+
+ * *.c: Changed many functions to static. Some commented out
+ functions and some tiny related fixes. No functional changes.
+
2005-01-01 Hasso Tepper <hasso at quagga.net>
* isis_common.h, isisd.c, isis_pdu.c: Implement authentication in
extern struct isis *isis;
-struct isis_adjacency *
+static struct isis_adjacency *
adj_alloc (u_char * id)
{
struct isis_adjacency *adj;
return 0;
}
-const char *
+static const char *
adj_state2string (int state)
{
/*
* show clns/isis neighbor (detail)
*/
-void
+static void
isis_adj_print_vty2 (struct isis_adjacency *adj, struct vty *vty, char detail)
{
return ISIS_OK;
}
-int
+static int
isis_check_dr_change (struct isis_adjacency *adj, int level)
{
int i;
}
-void
+static void
circuit_commence_level (struct isis_circuit *circuit, int level)
{
if (level == 1)
return;
}
-void
+static void
circuit_resign_level (struct isis_circuit *circuit, int level)
{
int idx = level - 1;
return NULL;
}
-void
+static void
lsp_clear_data (struct isis_lsp *lsp)
{
if (!lsp)
return;
}
-void
+static void
lsp_destroy (struct isis_lsp *lsp)
{
if (!lsp)
/*
* Remove all the frags belonging to the given lsp
*/
-void
+static void
lsp_remove_frags (struct list *frags, dict_t * lspdb)
{
dnode_t *dnode;
/*
* Genetates checksum for LSP and its frags
*/
-void
+static void
lsp_seqnum_update (struct isis_lsp *lsp0)
{
struct isis_lsp *lsp;
return authentication_check (passwd, &tlvs.auth_info);
}
-void
+static void
lsp_update_data (struct isis_lsp *lsp, struct stream *stream,
struct isis_area *area)
{
return;
}
-void
+static void
lsp_set_time (struct isis_lsp *lsp)
{
assert (lsp);
htons (ntohs (lsp->lsp_header->rem_lifetime) - 1);
}
-void
+static void
lspid_print (u_char * lsp_id, u_char * trg, char dynhost, char frag)
{
struct isis_dynhn *dyn = NULL;
}
/* this function prints the lsp on show isis database */
-void
+static void
lsp_print (dnode_t * node, struct vty *vty, char dynhost)
{
struct isis_lsp *lsp = dnode_get (node);
lsp_bits2string (&lsp->lsp_header->lsp_bits), VTY_NEWLINE);
}
-void
+static void
lsp_print_detail (dnode_t * node, struct vty *vty, char dynhost)
{
struct isis_lsp *lsp = dnode_get (node);
return lsp_count;
}
+#if 0 /* Seems to be old code */
/* this function reallocate memory to an lsp pdu, with an additional
* size of memory, it scans the lsp and moves all pointers the
* way they should */
-u_char *
+static u_char *
lsppdu_realloc (struct isis_lsp * lsp, int memorytype, int size)
{
u_char *retval;
return STREAM_DATA (lsp->pdu) + (lsp->lsp_header->pdu_len - size);
#endif /* LSP_MEMORY_PREASSIGN */
}
+#endif /* 0 */
#if 0 /* Saving the old one just in case :) */
/*
#define FRAG_NEEDED(S,T,I) \
(STREAM_SIZE(S)-STREAM_REMAIN(S)+(I) > FRAG_THOLD(S,T))
-void
+static void
lsp_tlv_fit (struct isis_lsp *lsp, struct list **from, struct list **to,
int tlvsize, int frag_thold,
int tlv_build_func (struct list *, struct stream *))
return;
}
-struct isis_lsp *
+static struct isis_lsp *
lsp_next_frag (u_char frag_num, struct isis_lsp *lsp0, struct isis_area *area,
int level)
{
* area->lsp_frag_threshold is exceeded.
*/
#if 1
-void
+static void
lsp_build_nonpseudo (struct isis_lsp *lsp, struct isis_area *area)
{
struct is_neigh *is_neigh;
}
#endif
-void
+#if 0 /* Old code? */
+static void
build_lsp_data (struct isis_lsp *lsp, struct isis_area *area)
{
struct list *circuit_list = area->circuit_list;
}
}
+#endif /* 0 */
/*
* 7.3.7 Generation on non-pseudonode LSPs
*/
-int
+static int
lsp_generate_non_pseudo (struct isis_area *area, int level)
{
struct isis_lsp *oldlsp, *newlsp;
return lsp_generate_non_pseudo (area, 2);
}
-int
+static int
lsp_non_pseudo_regenerate (struct isis_area *area, int level)
{
dict_t *lspdb = area->lspdb[level - 1];
* Something has changed -> regenerate LSP
*/
-int
+static int
lsp_l1_regenerate (struct thread *thread)
{
struct isis_area *area;
return lsp_non_pseudo_regenerate (area, 1);
}
-int
+static int
lsp_l2_regenerate (struct thread *thread)
{
struct isis_area *area;
/*
* 7.3.8 and 7.3.10 Generation of level 1 and 2 pseudonode LSPs
*/
-void
+static void
lsp_build_pseudo (struct isis_lsp *lsp, struct isis_circuit *circuit,
int level)
{
return;
}
-int
+static int
lsp_pseudo_regenerate (struct isis_circuit *circuit, int level)
{
dict_t *lspdb = circuit->area->lspdb[level - 1];
}
#ifdef TOPOLOGY_GENERATE
-int
+static int
top_lsp_refresh (struct thread *thread)
{
struct isis_lsp *lsp;
* FIXME: and the p2p multicast being ???
*/
#ifdef GNU_LINUX
-int
+static int
isis_multicast_join (int fd, int registerto, int if_num)
{
struct packet_mreq mreq;
return ISIS_OK;
}
-int
+static int
open_packet_socket (struct isis_circuit *circuit)
{
struct sockaddr_ll s_addr;
#else
-int
+static int
open_bpf_dev (struct isis_circuit *circuit)
{
int i = 0, fd;
* return 0 the IIH's IP is not in the IS's subnetwork
* 1 the IIH's IP is in the IS's subnetwork
*/
-int
+static int
ip_same_subnet (struct prefix_ipv4 *ip1, struct in_addr *ip2)
{
u_char *addr1, *addr2;
/*
* Processing helper functions
*/
-void
+static void
tlvs_to_adj_nlpids (struct tlvs *tlvs, struct isis_adjacency *adj)
{
int i;
}
}
-void
+static void
del_ip_addr (void *val)
{
XFREE (MTYPE_ISIS_TMP, val);
}
-void
+static void
tlvs_to_adj_ipv4_addrs (struct tlvs *tlvs, struct isis_adjacency *adj)
{
struct listnode *node;
}
#ifdef HAVE_IPV6
-void
+static void
tlvs_to_adj_ipv6_addrs (struct tlvs *tlvs, struct isis_adjacency *adj)
{
struct listnode *node;
* Section 7.3.15.2 - Action on receipt of a sequence numbers PDU
*/
-int
+static int
process_snp (int snp_type, int level, struct isis_circuit *circuit,
u_char * ssnpa)
{
return retval;
}
-int
+static int
process_csnp (int level, struct isis_circuit *circuit, u_char * ssnpa)
{
/* Sanity check - FIXME: move to correct place */
return process_snp (ISIS_SNP_CSNP_FLAG, level, circuit, ssnpa);
}
-int
+static int
process_psnp (int level, struct isis_circuit *circuit, u_char * ssnpa)
{
if ((stream_get_endp (circuit->rcv_stream) -
* 0x38 0x08 0x47 0x00 0x01 0x00 0x02 0x00
* 0x03 0x00 0x81 0x01 0xcc
*/
-int
+static int
process_is_hello (struct isis_circuit *circuit)
{
struct isis_adjacency *adj;
* PDU Dispatcher
*/
-int
+static int
isis_handle_pdu (struct isis_circuit *circuit, u_char * ssnpa)
{
struct isis_fixed_hdr *hdr;
/*
* SEND SIDE
*/
-void
+static void
fill_fixed_hdr_andstream (struct isis_fixed_hdr *hdr, u_char pdu_type,
struct stream *stream)
{
return retval;
}
-int
+static int
send_lan_hello (struct isis_circuit *circuit, int level)
{
return send_hello (circuit, level);
return ISIS_OK;
}
-int
+static int
build_csnp (int level, u_char * start, u_char * stop, struct list *lsps,
struct isis_circuit *circuit)
{
return retval;
}
-int
+static int
build_psnp (int level, struct isis_circuit *circuit, struct list *lsps)
{
struct isis_fixed_hdr fixed_hdr;
* 7.3.15.4 action on expiration of partial SNP interval
* level 1
*/
-int
+static int
send_psnp (int level, struct isis_circuit *circuit)
{
int retval = ISIS_OK;
return retval;
}
-void
+/* FIXME: Not used any more? */
+/* static void
build_link_state (struct isis_lsp *lsp, struct isis_circuit *circuit,
struct stream *stream)
{
length = stream_get_putp (stream);
return;
-}
+} */
/*
* ISO 10589 - 7.3.14.3
extern struct isis *isis;
extern struct thread_master *master;
-struct isis_nexthop *
+static struct isis_nexthop *
isis_nexthop_create (struct in_addr *ip, unsigned int ifindex)
{
struct listnode *node;
return nexthop;
}
-void
+static void
isis_nexthop_delete (struct isis_nexthop *nexthop)
{
nexthop->lock--;
return;
}
-int
+static int
nexthoplookup (struct list *nexthops, struct in_addr *ip,
unsigned int ifindex)
{
return 0;
}
-void
+#if 0 /* Old or new code? */
+static void
nexthop_print (struct isis_nexthop *nh)
{
u_char buf[BUFSIZ];
zlog_debug (" %s %u", buf, nh->ifindex);
}
-void
+static void
nexthops_print (struct list *nhs)
{
struct listnode *node;
for (node = listhead (nhs); node; nextnode (node))
nexthop_print (getdata (node));
}
+#endif /* 0 */
#ifdef HAVE_IPV6
-
-struct isis_nexthop6 *
+static struct isis_nexthop6 *
isis_nexthop6_new (struct in6_addr *ip6, unsigned int ifindex)
{
return nexthop6;
}
-struct isis_nexthop6 *
+static struct isis_nexthop6 *
isis_nexthop6_create (struct in6_addr *ip6, unsigned int ifindex)
{
struct listnode *node;
return nexthop6;
}
-void
+static void
isis_nexthop6_delete (struct isis_nexthop6 *nexthop6)
{
return;
}
-int
+static int
nexthop6lookup (struct list *nexthops6, struct in6_addr *ip6,
unsigned int ifindex)
{
return 0;
}
-void
+#ifdef EXTREME_DEBUG
+static void
nexthop6_print (struct isis_nexthop6 *nh6)
{
u_char buf[BUFSIZ];
zlog_debug (" %s %u", buf, nh6->ifindex);
}
-void
+static void
nexthops6_print (struct list *nhs6)
{
struct listnode *node;
for (node = listhead (nhs6); node; nextnode (node))
nexthop6_print (getdata (node));
}
-
-
+#endif /* EXTREME_DEBUG */
#endif /* HAVE_IPV6 */
-void
+static void
adjinfo2nexthop (struct list *nexthops, struct isis_adjacency *adj)
{
struct isis_nexthop *nh;
}
#ifdef HAVE_IPV6
-void
+static void
adjinfo2nexthop6 (struct list *nexthops6, struct isis_adjacency *adj)
{
struct listnode *node;
}
#endif /* HAVE_IPV6 */
-struct isis_route_info *
+static struct isis_route_info *
isis_route_info_new (uint32_t cost, uint32_t depth, u_char family,
struct list *adjacencies)
{
return rinfo;
}
-void
+static void
isis_route_info_delete (struct isis_route_info *route_info)
{
if (route_info->nexthops)
XFREE (MTYPE_ISIS_ROUTE_INFO, route_info);
}
-int
+static int
isis_route_info_same_attrib (struct isis_route_info *new,
struct isis_route_info *old)
{
return 1;
}
-int
+static int
isis_route_info_same (struct isis_route_info *new,
struct isis_route_info *old, u_char family)
{
return 1;
}
-void
+static void
isis_nexthops_merge (struct list *new, struct list *old)
{
struct listnode *node;
}
#ifdef HAVE_IPV6
-void
+static void
isis_nexthops6_merge (struct list *new, struct list *old)
{
struct listnode *node;
}
#endif /* HAVE_IPV6 */
-void
+static void
isis_route_info_merge (struct isis_route_info *new,
struct isis_route_info *old, u_char family)
{
return;
}
-int
+static int
isis_route_info_prefer_new (struct isis_route_info *new,
struct isis_route_info *old)
{
return route_info;
}
-void
+static void
isis_route_delete (struct prefix *prefix, struct route_table *table)
{
struct route_node *rode;
int isis_run_spf_l1 (struct thread *thread);
int isis_run_spf_l2 (struct thread *thread);
-/* performace issue ???? */
-void
+#if 0
+/* performace issue ???? HT: Old or new code? */
+static void
union_adjlist (struct list *target, struct list *source)
{
struct isis_adjacency *adj, *adj2;
listnode_add (target, adj);
}
}
+#endif
/* 7.2.7 */
-void
+static void
remove_excess_adjs (struct list *adjs)
{
struct listnode *node, *excess = NULL;
return;
}
-const char *
+#ifdef EXTREME_DEBUG
+static const char *
vtype2string (enum vertextype vtype)
{
switch (vtype)
return NULL; /* Not reached */
}
-const char *
+static const char *
vid2string (struct isis_vertex *vertex, u_char * buff)
{
switch (vertex->type)
return (char *) buff;
}
+#endif /* EXTREME_DEBUG */
-struct isis_spftree *
+static struct isis_spftree *
isis_spftree_new ()
{
struct isis_spftree *tree;
return tree;
}
-void
+static void
isis_vertex_del (struct isis_vertex *vertex)
{
list_delete (vertex->Adj_N);
return;
}
-void
+#if 0 /* HT: Not used yet. */
+static void
isis_spftree_del (struct isis_spftree *spftree)
{
spftree->tents->del = (void (*)(void *)) isis_vertex_del;
return;
}
+#endif
void
spftree_area_init (struct isis_area *area)
return;
}
-struct isis_vertex *
+static struct isis_vertex *
isis_vertex_new (void *id, enum vertextype vtype)
{
struct isis_vertex *vertex;
/*
* Add this IS to the root of SPT
*/
-void
+static void
isis_spf_add_self (struct isis_spftree *spftree, struct isis_area *area,
int level)
{
return;
}
-struct isis_vertex *
+static struct isis_vertex *
isis_find_vertex (struct list *list, void *id, enum vertextype vtype)
{
struct listnode *node;
/*
* Add a vertex to TENT sorted by cost and by vertextype on tie break situation
*/
-struct isis_vertex *
+static struct isis_vertex *
isis_spf_add2tent (struct isis_spftree *spftree, enum vertextype vtype,
void *id, struct isis_adjacency *adj, u_int16_t cost,
int depth, int family)
return vertex;
}
-struct isis_vertex *
+static struct isis_vertex *
isis_spf_add_local (struct isis_spftree *spftree, enum vertextype vtype,
void *id, struct isis_adjacency *adj, u_int16_t cost,
int family)
return isis_spf_add2tent (spftree, vtype, id, adj, cost, 1, family);
}
-void
+static void
process_N (struct isis_spftree *spftree, enum vertextype vtype, void *id,
u_int16_t dist, u_int16_t depth, struct isis_adjacency *adj,
int family)
/*
* C.2.6 Step 1
*/
-int
+static int
isis_spf_process_lsp (struct isis_spftree *spftree, struct isis_lsp *lsp,
uint16_t cost, uint16_t depth, int family)
{
return ISIS_OK;
}
-int
+static int
isis_spf_process_pseudo_lsp (struct isis_spftree *spftree,
struct isis_lsp *lsp, uint16_t cost,
uint16_t depth, int family)
return ISIS_OK;
}
-int
+static int
isis_spf_preload_tent (struct isis_spftree *spftree,
struct isis_area *area, int level, int family)
{
* The parent(s) for vertex is set when added to TENT list
* now we just put the child pointer(s) in place
*/
-void
+static void
add_to_paths (struct isis_spftree *spftree, struct isis_vertex *vertex,
struct isis_area *area)
{
return;
}
-void
+static void
init_spt (struct isis_spftree *spftree)
{
spftree->tents->del = spftree->paths->del = (void (*)(void *)) isis_vertex_del;
return;
}
-int
+static int
isis_run_spf (struct isis_area *area, int level, int family)
{
int retval = ISIS_OK;
}
#ifdef HAVE_IPV6
-int
+static int
isis_run_spf6_l1 (struct thread *thread)
{
struct isis_area *area;
return retval;
}
-int
+static int
isis_run_spf6_l2 (struct thread *thread)
{
struct isis_area *area;
}
#endif
-void
+static void
isis_print_paths (struct vty *vty, struct list *paths)
{
struct listnode *node, *anode;
struct isis_vertex *vertex;
struct isis_dynhn *dyn, *nh_dyn = NULL;
struct isis_adjacency *adj;
-#ifdef EXTREME_DEBUG
+#if 0
u_char buff[255];
-#endif
+#endif /* 0 */
vty_out (vty, "System Id Metric Next-Hop"
" Interface SNPA%s", VTY_NEWLINE);
* +-------+-------+-------+-------+-------+-------+-------+-------+
*/
#ifdef EXTREME_TLV_DEBUG
- zlog_debug ("LSP Entries length %d", areatag, length);
+ zlog_debug ("ISIS-TLV (%s): LSP Entries length %d", areatag, length);
#endif /* EXTREME_TLV_DEBUG */
*found |= TLVFLAG_LSP_ENTRIES;
if (TLVFLAG_LSP_ENTRIES & *expected)
struct in_addr router_id_zebra;
/* Router-id update message from zebra. */
-int
+static int
isis_router_id_update_zebra (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
isis_zebra_if_add (int command, struct zclient *zclient, zebra_size_t length)
{
struct interface *ifp;
return 0;
}
-int
+static int
isis_zebra_if_del (int command, struct zclient *zclient, zebra_size_t length)
{
struct interface *ifp;
return 0;
}
-struct interface *
+static struct interface *
zebra_interface_if_lookup (struct stream *s)
{
struct interface *ifp;
return ifp;
}
-int
+static int
isis_zebra_if_state_up (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
isis_zebra_if_state_down (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
isis_zebra_if_address_add (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
isis_zebra_if_address_del (int command, struct zclient *client,
zebra_size_t length)
{
return 0;
}
-void
+static void
isis_zebra_route_add_ipv4 (struct prefix *prefix,
struct isis_route_info *route_info)
{
}
}
-void
+static void
isis_zebra_route_del_ipv4 (struct prefix *prefix,
struct isis_route_info *route_info)
{
return;
}
-void
+static void
isis_zebra_route_del_ipv6 (struct prefix *prefix,
struct isis_route_info *route_info)
{
return;
}
-int
+static int
isis_zebra_read_ipv4 (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+static int
isis_zebra_read_ipv6 (int command, struct zclient *zclient,
zebra_size_t length)
{
return 0;
}
-int
+#if 0 /* Not yet. */
+static int
isis_redistribute_default_set (int routetype, int metric_type,
int metric_value)
{
return 0;
}
+#endif /* 0 */
void
isis_zebra_init ()