summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_asbr.c
Commit message (Collapse)AuthorAgeFilesLines
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-02-261-2/+3
|
* Fix most compiler warnings in default GCC build.Paul Jakma2014-09-231-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix lots of warnings. Some const and type-pun breaks strict-aliasing warnings left but much reduced. * bgp_advertise.h: (struct bgp_advertise_fifo) is functionally identical to (struct fifo), so just use that. Makes it clearer the beginning of (struct bgp_advertise) is compatible with with (struct fifo), which seems to be enough for gcc. Add a BGP_ADV_FIFO_HEAD macro to contain the right cast to try shut up type-punning breaks strict aliasing warnings. * bgp_packet.c: Use BGP_ADV_FIFO_HEAD. (bgp_route_refresh_receive) fix an interesting logic error in (!ok || (ret != BLAH)) where ret is only well-defined if ok. * bgp_vty.c: Peer commands should use bgp_vty_return to set their return. * jhash.{c,h}: Can take const on * args without adding issues & fix warnings. * libospf.h: LSA sequence numbers use the unsigned range of values, and constants need to be set to unsigned, or it causes warnings in ospf6d. * md5.h: signedness of caddr_t is implementation specific, change to an explicit (uint_8 *), fix sign/unsigned comparison warnings. * vty.c: (vty_log_fixed) const on level is well-intentioned, but not going to fly given iov_base. * workqueue.c: ALL_LIST_ELEMENTS_RO tests for null pointer, which is always true for address of static variable. Correct but pointless warning in this case, but use a 2nd pointer to shut it up. * ospf6_route.h: Add a comment about the use of (struct prefix) to stuff 2 different 32 bit IDs into in (struct ospf6_route), and the resulting type-pun strict-alias breakage warnings this causes. Need to use 2 different fields to fix that warning? general: * remove unused variables, other than a few cases where they serve a sufficiently useful documentary purpose (e.g. for code that needs fixing), or they're required dummies. In those cases, try mark them as unused. * Remove dead code that can't be reached. * Quite a few 'no ...' forms of vty commands take arguments, but do not check the argument matches the command being negated. E.g., should 'distance X <prefix>' succeed if previously 'distance Y <prefix>' was set? Or should it be required that the distance match the previously configured distance for the prefix? Ultimately, probably better to be strict about this. However, changing from slack to strict might expose problems in command aliases and tools. * Fix uninitialised use of variables. * Fix sign/unsigned comparison warnings by making signedness of types consistent. * Mark functions as static where their use is restricted to the same compilation unit. * Add required headers * Move constants defined in headers into code. * remove dead, unused functions that have no debug purpose.
* *: nuke ^L (page feed)David Lamparter2014-06-041-4/+4
| | | | | | | | | | | | | | Quagga sources have inherited a slew of Page Feed (^L, \xC) characters from ancient history. Among other things, these break patchwork's XML-RPC API because \xC is not a valid character in XML documents. Nuke them from high orbit. Patches can be adapted simply by: sed -e 's%^L%%' -i filename.patch (you can type page feeds in some environments with Ctrl-V Ctrl-L) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: fix refcounting in ospf6_asbr_lsa_removeChristian Franke2014-03-211-0/+2
| | | | | | | When iterating over a list, also the last node should be unlocked again. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: improve ordered shutdownChristian Franke2014-03-181-2/+16
| | | | | | | | Improve the _disable/_enable infrastructure so it gets into a more usable shape and make 'no router ospf6' actually work. Signed-off-by: Christian Franke <chris@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: handle Prefix and Router Options bits correctlyDinesh Dutt2013-11-071-0/+7
| | | | | | | | | | Ensure that prefixes with the NU/LA bit set do not get added to the routing table. Ensure that routers with the V6/R bit set do not get added as transit routes. Signed-off-by: Dinesh Dutt <ddutt at cumulusnetworks.com> [DL: adjust to rebase] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d: add LSA payload to show summary outputDinesh Dutt2013-11-071-11/+41
| | | | | | | | | | | | | | | | | Unlike OSPFv2, the LSID of an LSA isn't sufficient to know what the contents of the LSA are. Its useful for debugging and basic eyeball tests to see the contents of the LSA in the simple tabular format of "show ipv6 ospf6 database". This patch adds that output to the command. It replaces the existing fields of "duration, Chksum and Length" with a single field called Payload which is dependent on the LSA type. For Inter-Area Prefix, Intra-Area Prefix and AS-External LSAs, this will be the advertised prefix/prefix length, for Router LSAs, it is RtrID/IfID etc. Signed-off-by: Dinesh G Dutt <ddutt at cumulusnetworks.com> Reviewed-by: Pradosh Mohapatra <pmohapat at cumulusnetworks.com> Reviewed-by: Scott Feldman <sfeldma at cumulusnetworks.com> [DL: rebase fix, line disappeared in ospf6_abr_originate_summary_to_area] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* ospf6d/ospfd: refactor some common definesDinesh Dutt2013-10-221-2/+2
| | | | | | | | | Rearranging common defs and structures for use betweeen OSPFv2 and OSPFv3. Created a new file called libospf.h under lib directory to hold defines that are common between OSPFv2 and OSPFv3 code bases. [DL: split of defines refactor from timer refactor] Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* lib: put route_types.txt to real useDavid Lamparter2011-12-131-54/+21
| | | | | | | | | | | this replaces most occurences of routing protocol lists by preprocessor defines from route_types.h. the latter is autogenerated from route_types.txt by a perl script (previously awk). adding a routing protocol now is mostly a matter of changing route_types.txt and log.c. Conflicts: lib/route_types.awk
* ospf6d: implement 'match interface' for route-mapsVyacheslav Trushkin2011-12-131-0/+89
| | | | | | | | ospf6_routemap_rule_match_interface* was imported from ospfd daemon with minor changes. new CLI options defined. `ospf6_routemap_rule_match_interface' was changed to support IPv6 (ospfv3) route's external information.
* ospf6d: Have ospf6d cleanup when it terminates normallyTom Goff2011-03-211-0/+5
| | | | | | | | | | | | | | | A clean exit makes it easier to use memory debuggers. * ospf6_asbr.c: (ospf6_asbr_terminate) Add a function to do route map cleanup. * ospf6_lsa.c: (ospf6_lsa_terminate) Add a function to cleanup the lsa handler vector. * ospf6_main.c: (ospf6_exit) Add an function that causes ospf6d to gracefully exit. * ospf6_message.c: (ospf6_message_terminate) Add a function that frees the send and receive buffers. * ospf6_top.c: (ospf6_delete) Enable the ospf6_delete() function. Disable ospf6 before freeing everything.
* [cleanup] Convert XMALLOC/memset to XCALLOCStephen Hemminger2009-06-121-2/+1
| | | | Simple conversion of XMALLOC/memset to XCALLOC
* [trivia] finish off static'ification of ospf6d and ripngdPaul Jakma2008-08-221-25/+25
| | | | | | | | | 2008-08-15 Paul Jakma <paul.jakma@sun.com> * {ospf6d,ripngd}/*: Finish job of marking functions as static, or exporting declarations for them, to quell warning noise with Quagga's GCC default high-level of warning flags. Thus allowing remaining, more useful warnings to be more easily seen.
* [ospf6d] Fix removal of defunct ASBR routesPaul Jakma2007-10-221-9/+0
| | | | | | | | | 2007-10-22 Phil Spagnolo <phillip.a.spagnolo@boeing.com> * ospf6_asbr.c: (ospf6_asbr_lsentry_remove) Remove shortcut of LSDB search - it's based on assumption non-BEST routes can't have ASBR routes, which appears to be wrong. Safest to search.
* [ospf6d] GNU Zebra 3563: Fix as-external forwarding addressPaul Jakma2006-05-151-2/+3
| | | | | | | 2006-03-01 Yasuhiro Ohara <yasu@sfc.wide.ad.jp> * ospf6_asbr.c: fix bug of needless forwarding address * ospf6d.h: version 0.9.7r
* [ospf6d] Import GNU Zebra CVSps#3559: Fix inter-area as-ext bug, cleanup debugPaul Jakma2006-05-151-22/+14
| | | | | | | | | 2005-10-06 Yasuhiro Ohara <yasu@sfc.wide.ad.jp> * ospf6_asbr.c: fix bug of calculating AS-External routes in other areas. Add debugging function for border-router calculation. * ospf6d.h: version 0.9.7p
* 2005-10-01 Andrew J. Schorr <ajschorr@alumni.princeton.edu>ajs2005-10-011-15/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * zebra.h: Declare new functions zebra_route_string() and zebra_route_char(). * log.c: (zroute_lookup,zebra_route_string,zebra_route_char) New functions to map zebra route numbers to strings. * zebra_vty.c: (route_type_str) Remove obsolete function: use new library function zebra_route_string() instead. Note that there are a few differences: for IPv6 routes, we now get "ripng" and "ospf6" instead of the old behavior ("rip" and "ospf"). (route_type_char) Remove obsolete function: ues new library function zebra_route_char() instead. Note that there is one difference: the old function returned 'S' for a ZEBRA_ROUTE_SYSTEM route, whereas the new one returns 'X'. (vty_show_ip_route_detail,vty_show_ipv6_route_detail) Replace route_type_str() with zebra_route_string(). (vty_show_ip_route,vty_show_ipv6_route) Replace route_type_char() with zebra_route_char(). * bgp_vty.c: (bgp_config_write_redistribute) Use new library function zebra_route_string instead of a local hard-coded table. * ospf6_asbr.c: Remove local hard-coded tables zroute_name and zroute_abname. Change the ZROUTE_NAME macro to use new library function zebra_route_string(). Remove the ZROUTE_ABNAME macro. (ospf6_asbr_external_route_show): Replace ZROUTE_ABNAME() with a call to zebra_route_char(), and be sure to fix the format string, since we now have a char instead of a char *. * ospf6_zebra.c: Remove local hard-coded tables zebra_route_name and zebra_route_abname. Note that the zebra_route_name[] table contained mixed-case strings, whereas the zebra_route_string() function returns lower-case strings. (ospf6_zebra_read_ipv6): Change debug message to use new library function zebra_route_string() instead of zebra_route_name[]. (show_zebra): Use new library function zebra_route_string() instead of zebra_route_name[]. * ospf_dump.c: Remove local hard-coded table ospf_redistributed_proto. (ospf_redist_string) New function implemented using new library function zebra_route_string(). Note that there are a few differences in the output that will result: the new function returns strings that are lower-case, whereas the old table was mixed case. Also, the old table mapped ZEBRA_ROUTE_OSPF6 to "OSPFv3", whereas the new function returns "ospf6". * ospfd.h: Remove extern struct message ospf_redistributed_proto[], and add extern const char *ospf_redist_string(u_int route_type) instead. * ospf_asbr.c: (ospf_external_info_add) In two messages, use ospf_redist_string instead of LOOKUP(ospf_redistributed_proto). * ospf_vty.c: Remove local hard-coded table distribute_str. (config_write_ospf_redistribute,config_write_ospf_distribute): Use new library function zebra_route_string() instead of distribute_str[]. * ospf_zebra.c: (ospf_redistribute_set,ospf_redistribute_unset, ospf_redistribute_default_set,ospf_redistribute_check) In debug messages, use ospf_redist_string() instead of LOOKUP(ospf_redistributed_proto). * rip_zebra.c: (config_write_rip_redistribute): Remove local hard-coded table str[]. Replace str[] with calls to new library function zebra_route_string(). * ripd.c: Remove local hard-coded table route_info[]. (show_ip_rip) Replace uses of str[] with calls to new library functions zebra_route_char and zebra_route_string. * ripng_zebra.c: (ripng_redistribute_write) Remove local hard-coded table str[]. Replace str[i] with new library function zebra_route_string(i). * ripngd.c: Remove local hard-coded table route_info[]. (show_ipv6_ripng) Use new library function zebra_route_char() instead of table route_info[].
* 2005-08-09 Paul Jakma <paul.jakma@sun.com>paul2005-08-101-1/+1
| | | | | | | | | * ospf6_asbr.c: (ospf6_asbr_redistribute_add) Fix sense of testing of route_map_apply return code, it can return many things other than RMAP_MATCH which do not indicate DENY. Should test explicitly for equality to RMAP_DENYMATCH instead. [backport candidate]
* 2005-04-07 Paul Jakma <paul.jakma@sun.com>quagga_post_listloop_cleanuppaul2005-04-071-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * (global): Fix up list loops to match changes in lib/linklist, and some basic auditing of usage. * configure.ac: define QUAGGA_NO_DEPRECATED_INTERFACES * HACKING: Add notes about deprecating interfaces and commands. * lib/linklist.h: Add usage comments. Rename getdata macro to listgetdata. Rename nextnode to listnextnode and fix its odd behaviour to be less dangerous. Make listgetdata macro assert node is not null, NULL list entries should be bug condition. ALL_LIST_ELEMENTS, new macro, forward-referencing macro for use with for loop, Suggested by Jim Carlson of Sun. Add ALL_LIST_ELEMENTS_RO for cases which obviously do not need the "safety" of previous macro. LISTNODE_ADD and DELETE macros renamed to ATTACH, DETACH, to distinguish from the similarly named functions, and reflect their effect better. Add a QUAGGA_NO_DEPRECATED_INTERFACES define guarded section with the old defines which were modified above, for backwards compatibility - guarded to prevent Quagga using it.. * lib/linklist.c: fix up for linklist.h changes. * ospf6d/ospf6_abr.c: (ospf6_abr_examin_brouter) change to a single scan of the area list, rather than scanning all areas first for INTER_ROUTER and then again for INTER_NETWORK. According to 16.2, the scan should be area specific anyway, and further ospf6d does not seem to implement 16.3 anyway.
* 2005-01-25 Paul Jakma <paul@dishone.st>paul2005-01-251-2/+2
| | | | * ospf6_asbr.c: Add "hsls" to the zroute_name const char array.
* *.c: Change level of debug messages to LOG_DEBUG.hasso2004-12-241-21/+21
|
* 2004-10-10 Paul Jakma <paul@dishone.st>paul2004-10-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | * ospf6_route.c: Add const qualifier to various char arrays of constants. signed/unsigned fixes. (ospf6_linkstate_table_show) argv is const * ospf6_snmp.c: listnode typedef is dead. (ospf6_snmp_init) Take struct thread_master arg, needed for smux_init. * ospf6_snmp.h: update ospf6_snmp_init declaration. * ospf6d.c: (ospf6_init) add const qualifier to sargv, pass master to ospf_snmp6_init. * ospf6_asbr.c: const char update. * ospf6_interface.c: ditto, plus signed/unsigned fixes. (ipv6_ospf6_cost) Check whether cost fits in u_int32_t and use strtoul. * ospf6_intra.c: const char update. Parenthesise expression. * ospf6_lsa.c: signed/unsigned and const char updates. * ospf6_proto.c: ditto. * ospf6_message.c: ditto. * ospf6_lsdb.c: signed/unsigned update. * ospf6_main.c: const char update. * ospf6_neighbor.c: ditto. * ospf6_spf.c: ditto. * ospf6_top.c: ditto.
* Merge svn revision 1048 from Zebra cvs. Also add missing sokopt.h includehasso2004-09-291-2/+2
| | | | to ospf6_network.h.
* Remove usage of evil list and listnode typedefs.hasso2004-09-231-2/+2
|
* Merge svn revisions 978-979 from Zebra CVS.hasso2004-09-021-1/+2
|
* Merge svn revision 975 from Zebra repository.hasso2004-09-011-14/+14
|
* SVN revisions 935-940 merge from Zebra CVS.hasso2004-08-251-4/+1
|
* Merge svn revisions 924 and 925 from Zebra CVS. Also remove uselesshasso2004-08-191-0/+2
| | | | | ospf6_lsdb prototype declaration from ospf6_lsa.h. Report sent to Yasuhiro Ohara as well.
* SVN revisions 916-920 from Zebra. ABR support is almost done.hasso2004-08-151-115/+21
|
* SVN revision 907 from Zebra cvs repository.hasso2004-08-041-20/+20
|
* Update to latest (really :) ospf6d from Zebra repository and some tinyhasso2004-05-181-2/+2
| | | | fixes.
* Ospf6d merge from Zebra repository with added privs stuff and mergedhasso2004-05-181-785/+1090
| | | | zclient changes.
* Fixing ospf6d as well and move Changelog entry from ospfd to general one.hasso2004-03-201-2/+2
|
* ospf6d part of 6Wind patch.hasso2003-05-251-2/+51
|
* Initial revisionpaul2002-12-131-0/+1040