diff options
Diffstat (limited to 'isisd')
-rw-r--r-- | isisd/Makefile.am | 11 | ||||
-rw-r--r-- | isisd/dict.c | 36 | ||||
-rw-r--r-- | isisd/dict.h | 3 | ||||
-rw-r--r-- | isisd/isis_bpf.c | 3 | ||||
-rw-r--r-- | isisd/isis_dlpi.c | 3 | ||||
-rw-r--r-- | isisd/isis_pfpacket.c | 3 | ||||
-rw-r--r-- | isisd/topology/spgrid.c | 3 |
7 files changed, 33 insertions, 29 deletions
diff --git a/isisd/Makefile.am b/isisd/Makefile.am index 9c303390..26b8ee7c 100644 --- a/isisd/Makefile.am +++ b/isisd/Makefile.am @@ -13,8 +13,6 @@ noinst_LIBRARIES = libisis.a sbin_PROGRAMS = isisd SUBDIRS = topology -isis_method = @ISIS_METHOD@ - libisis_a_SOURCES = \ isis_adjacency.c isis_lsp.c dict.c isis_circuit.c isis_pdu.c \ isis_tlv.c isisd.c isis_misc.c isis_zebra.c isis_dr.c \ @@ -30,13 +28,10 @@ noinst_HEADERS = \ include-netbsd/clnp.h include-netbsd/esis.h include-netbsd/iso.h isisd_SOURCES = \ - isis_main.c $(libisis_a_SOURCES) - -isisd_LDADD = $(isis_method) @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ - -isisd_DEPENDENCIES = $(isis_method) + isis_main.c $(libisis_a_SOURCES) \ + isis_bpf.c isis_dlpi.c isis_pfpacket.c -EXTRA_DIST = isis_bpf.c isis_dlpi.c isis_pfpacket.c +isisd_LDADD = @ISIS_TOPOLOGY_LIB@ ../lib/libzebra.la @LIBCAP@ examplesdir = $(exampledir) dist_examples_DATA = isisd.conf.sample diff --git a/isisd/dict.c b/isisd/dict.c index 6c3e1e7f..4d2400f6 100644 --- a/isisd/dict.c +++ b/isisd/dict.c @@ -18,9 +18,9 @@ * $Name$ */ +#include "zebra.h" #include <stdlib.h> #include <stddef.h> -#include "zebra.h" #include "zassert.h" #define DICT_IMPLEMENTATION #include "dict.h" @@ -32,7 +32,7 @@ static const char rcsid[] = "Id: dict.c,v 1.40.2.7 2000/11/13 01:36:44 kaz"; /* * These macros provide short convenient names for structure members, * which are embellished with dict_ prefixes so that they are - * properly confined to the documented namespace. It's legal for a + * properly confined to the documented namespace. It's legal for a * program which uses dict to define, for instance, a macro called ``parent''. * Such a macro would interfere with the dnode_t struct definition. * In general, highly portable and reusable C modules which expose their @@ -143,7 +143,7 @@ static void free_nodes(dict_t *dict, dnode_t *node, dnode_t *nil) * dict_next() successor function, verifying that the key of each node is * strictly lower than that of its successor, if duplicates are not allowed, * or lower or equal if duplicates are allowed. This function is used for - * debugging purposes. + * debugging purposes. */ static int verify_bintree(dict_t *dict) @@ -203,7 +203,7 @@ static unsigned int verify_redblack(dnode_t *nil, dnode_t *root) if (root->color != dnode_black) return 0; return height_left + 1; - } + } return 1; } @@ -336,7 +336,7 @@ dict_t *dict_init(dict_t *dict, dictcount_t maxcount, dict_comp_t comp) return dict; } -/* +/* * Initialize a dictionary in the likeness of another dictionary */ @@ -376,7 +376,7 @@ static void dict_clear(dict_t *dict) * debugging purposes, and should be placed in assert statements. Just because * this function succeeds doesn't mean that the tree is not corrupt. Certain * corruptions in the tree may simply cause undefined behavior. - */ + */ int dict_verify(dict_t *dict) { @@ -430,7 +430,7 @@ int dict_similar(const dict_t *left, const dict_t *right) /* * Locate a node in the dictionary having the given key. - * If the node is not found, a null a pointer is returned (rather than + * If the node is not found, a null a pointer is returned (rather than * a pointer that dictionary's nil sentinel node), otherwise a pointer to the * located node is returned. */ @@ -494,9 +494,9 @@ dnode_t *dict_lower_bound(dict_t *dict, const void *key) tentative = root; root = root->left; } - } + } } - + return tentative; } @@ -526,9 +526,9 @@ dnode_t *dict_upper_bound(dict_t *dict, const void *key) tentative = root; root = root->right; } - } + } } - + return tentative; } @@ -708,10 +708,10 @@ dnode_t *dict_delete(dict_t *dict, dnode_t *delete) child = (delete->left != nil) ? delete->left : delete->right; - child->parent = delparent = delete->parent; + child->parent = delparent = delete->parent; if (delete == delparent->left) { - delparent->left = child; + delparent->left = child; } else { assert (delete == delparent->right); delparent->right = child; @@ -1035,7 +1035,7 @@ void dict_load_next(dict_load_t *load, dnode_t *newnode, const void *key) { dict_t *dict = load->dictptr; dnode_t *nil = &load->nilnode; - + assert (!dnode_is_in_a_dict(newnode)); assert (dict->nodecount < dict->maxcount); @@ -1141,7 +1141,7 @@ void dict_merge(dict_t *dest, dict_t *source) dict_load_t load; dnode_t *leftnode = dict_first(dest), *rightnode = dict_first(source); - assert (dict_similar(dest, source)); + assert (dict_similar(dest, source)); if (source == dest) return; @@ -1174,7 +1174,7 @@ void dict_merge(dict_t *dest, dict_t *source) leftnode = next; continue; } - + copyright: { dnode_t *next = dict_next(source, rightnode); @@ -1202,7 +1202,7 @@ typedef char input_t[256]; static int tokenize(char *string, ...) { - char **tokptr; + char **tokptr; va_list arglist; int tokcount = 0; @@ -1266,7 +1266,7 @@ static void construct(dict_t *d) dnode_t *dn; char *tok1, *tok2, *val; const char *key; - char *help = + char *help = "p turn prompt on\n" "q finish construction\n" "a <key> <val> add new entry\n"; diff --git a/isisd/dict.h b/isisd/dict.h index 8cab985e..e381256f 100644 --- a/isisd/dict.h +++ b/isisd/dict.h @@ -21,8 +21,7 @@ #ifndef DICT_H #define DICT_H -#include "zconfig.h" -#include <limits.h> +#include "misc.h" #ifdef KAZLIB_SIDEEFFECT_DEBUG #include "sfx.h" #endif diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c index 8c3602db..05f11386 100644 --- a/isisd/isis_bpf.c +++ b/isisd/isis_bpf.c @@ -21,6 +21,7 @@ */ #include <zebra.h> +#if ISIS_METHOD == ISIS_METHOD_BPF #include <net/if.h> #include <netinet/if_ether.h> #include <sys/time.h> @@ -339,3 +340,5 @@ isis_send_pdu_p2p (struct isis_circuit *circuit, int level) { return ISIS_OK; } + +#endif /* ISIS_METHOD == ISIS_METHOD_BPF */ diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c index f4378464..1d9bf6a7 100644 --- a/isisd/isis_dlpi.c +++ b/isisd/isis_dlpi.c @@ -21,6 +21,7 @@ */ #include <zebra.h> +#if ISIS_METHOD == ISIS_METHOD_DLPI #include <net/if.h> #include <netinet/if_ether.h> #include <sys/types.h> @@ -622,3 +623,5 @@ isis_send_pdu_bcast (struct isis_circuit *circuit, int level) sock_buff, stream_get_endp (circuit->snd_stream) + LLC_LEN, 0); return ISIS_OK; } + +#endif /* ISIS_METHOD == ISIS_METHOD_DLPI */ diff --git a/isisd/isis_pfpacket.c b/isisd/isis_pfpacket.c index 8752dba5..9e4165e3 100644 --- a/isisd/isis_pfpacket.c +++ b/isisd/isis_pfpacket.c @@ -21,6 +21,7 @@ */ #include <zebra.h> +#if ISIS_METHOD == ISIS_METHOD_PFPACKET #include <net/ethernet.h> /* the L2 protocols */ #include <netpacket/packet.h> @@ -371,3 +372,5 @@ isis_send_pdu_p2p (struct isis_circuit *circuit, int level) return ISIS_OK; } + +#endif /* ISIS_METHOD == ISIS_METHOD_PFPACKET */ diff --git a/isisd/topology/spgrid.c b/isisd/topology/spgrid.c index 5197beb1..2aec9841 100644 --- a/isisd/topology/spgrid.c +++ b/isisd/topology/spgrid.c @@ -1,10 +1,11 @@ +#include <zebra.h> + #include <stdio.h> #include <stdlib.h> #include <string.h> #include "random.c" -#include <zebra.h> #include "thread.h" #include "vty.h" |