summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | zebra: include hardware addr in if up/down messagesJosh Bailey2012-04-081-27/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change interface up/down notification messages to also include the hardware address of the interface. The format of these messages is now identical to the interface add message -- move the serialization code to common functions. * lib/zclient.c: Modify zebra_interface_if_set_value() to also parse the hardware address. Invoke it from zebra_interface_add_read() and and zebra_interface_state_read(). * zebra/zserv.c: Add zserv_encode_interface(). Invoke it from zserv_interface_add(), zserv_interface_delete() and zserv_interface_update().
| * | lib: Tweak to if_delete_retain()Josh Bailey2012-04-081-1/+3
| | | | | | | | | | | | | | | | | | | | | * lib/if.c: Change if_delete_retain() to delete all connected addresses, but to not free the list that holds them. Free the list just before the interface structure itself is freed, in if_delete().
| * | isisd: add Google's changes to IS-ISJosh Bailey2012-04-071-0/+2
| | |
| * | lib: add stream_set_endp()Subbaiah Venkata2012-04-072-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/stream.[ch]: - Add stream_set_endp(). This can be used to trim data (for example, padding) at the end of a stream. - Fix swapped 'getp' and 'endp' parameters in STREAM_WARN_OFFSETS. From: Subbaiah Venkata <svenkata@google.com> Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@diac24.net>
| * | lib: add support for keyed-hashing with MD5Josh Bailey2012-04-072-0/+77
| | | | | | | | | | | | | | | | | | | | | | | | * lib/md5.[ch] Add implementation of HMAC-MD5 from RFC 2104. From: Josh Bailey <joshb@google.com> Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@diac24.net>
| * | lib: Tweaks to linked list macrosJosh Bailey2012-04-071-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/linklist.h - Change the listnextnode, listhead and listtail macros so that they allow the list pointer to be NULL. - Modify the ALL_LIST_ELEMENTS* macros such that they clear the data pointer at the beginning and end of the loop. From: Josh Bailey <joshb@google.com> Signed-off-by: Avneesh Sachdev <avneesh@opensourcerouting.org> Signed-off-by: David Lamparter <equinox@diac24.net>
* | | Merge branch 'quagga' into google-bgp-multipathAvneesh Sachdev2012-04-0934-566/+956
|\ \ \ | | |/ | |/| | | | | | | Conflicts: bgpd/bgp_route.c
| * | lib: pretty ip_masklen and masklen2ipDavid Lamparter2012-04-041-109/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nonwithstanding any desire for optimisation, these versions are shorter and more concise. reading the comments, they might even be easier to understand. I've tested them on i686 and x86_64, and checked that correct assembler code is emitted for ARM, MIPS and PowerPC. IPv6 is left as an exercise for another day, none of the ideas I had led to a "yes, this is the one to go with" solution. Signed-off-by: David Lamparter <equinox@diac24.net>
| * | Revert "lib: optimize ip_masklen()" (BZ#720)David Lamparter2012-04-041-2081/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d171bf58ef12ace43d48565e6870722dece1e6ed. There are multiple reasons for this revert, including bug #720, but also quite simply the unreadability of having 2000 lines of an autogenerated table in the middle of a source file. Signed-off-by: David Lamparter <equinox@diac24.net> Reported-by: Martin Winter <mwinter@opensourcerouting.org>
| * | memory: install babel memory informations.Matthieu Boutier2012-03-251-0/+3
| | |
| * | lib: update proto_redistnum() for BabelDenis Ovsienko2012-03-251-2/+6
| | |
| * | babeld: Initial import, for Babel routing protocol.Paul Jakma2012-03-2513-18/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial import of the Babel routing protocol, ported to Quagga. * LICENCE: Update the original LICENCE file to include all known potentially applicable copyright claims. Ask that any future contributors to babeld/ grant MIT/X11 licence to their work. * *.{c,h}: Add GPL headers, in according with the SFLC guidance on dealing with potentially mixed GPL/other licensed work, at: https://www.softwarefreedom.org/resources/2007/gpl-non-gpl-collaboration.html
| * | lib: fix endianness bug in prefix.cRenato Westphal2012-03-231-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While defining two "maskbytes" arrays for the respective endiannesses, the code was unconditionally using one that only worked on little endian systems. Use preprocessor macros to avoid the somewhat expensive htonl/ntohl macros. From: Renato Westphal <renatowestphal@gmail.com> Signed-off-by: David Lamparter <equinox@diac24.net>
| * | lib: fix incorrect thread list processing loopsPaul Jakma2012-02-281-2/+6
| | | | | | | | | | | | | | | | | | * thread.c: (thread_timer_process,thread_process) thread_list_delete nulls thread->next. Loops need to save next first, or will only process the head. Problem noted by Lou Berger <lberger@labn.net>.
| * | lib: fix logging of ZEBRA_HELLO messageDenis Ovsienko2012-02-211-0/+1
| | |
| * | lib: add THREAD_TIMER_MSEC_ON()Everton Marques2012-02-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/thread.h: new timer macro, millisecond precision (this was cherrypicked from pimd to isolate all non-contained changes) From: Everton Marques <everton.marques@gmail.com> Signed-off-by: David Lamparter <equinox@diac24.net>
| * | isisd: implement MD5 circuit authenticationFritz Reichmann2012-02-142-0/+76
| | | | | | | | | | | | | | | | | | * Replace command "isis passwd" with "isis passwd {clear|md5}" * Verify HMAC MD5 on ISIS Hello PDUs * Add HMAC MD5 authentication to md5.h/md5.c from RFC2104
| * | bgpd: IPv6 MP-BGP Routes addition and deletionG.Balaji2012-01-232-0/+3
| | | | | | | | | | | | | | | | | | This patch contains the following: 1. Addition of IPv6 SAFI_MULTICAST BGP routes into the BGP Multicast RIB. 2. Deletion of IPv6 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
| * | bgpd: IPv4 MP-BGP Routes addition and deletionG.Balaji2012-01-232-0/+3
| | | | | | | | | | | | | | | | | | This patch contains the following: 1. Addition of IPv4 SAFI_MULTICAST BGP routes into the BGP Multicast RIB. 2. Deletion of IPv4 SAFI_MULTICAST BGP routes from the BGP Multicast RIB.
| * | lib: use prefix bit length macrosDenis Ovsienko2012-01-081-7/+7
| | |
| * | lib/if: trivial, fix rarely used if debug function to print everythingPaul Jakma2012-01-061-6/+10
| | | | | | | | | | | | | | | | | | * if.c: (if_dump) loop that doesn't do anything, wants to be before the zlog of what it's meant to print out so all the connected addresses get printed out. Trival: just a debug function
| * | general: remove inline qualifiers and move in-header functions to objectsPaul Jakma2012-01-064-19/+22
| | | | | | | | | | | | | | | | | | * (general) Move functions in headers into files, to be compiled into shared object files. Remove inline qualifier from functions. Let the compiler do the work.
| * | lib: fix some strtoul() use casesUlrich Weber2012-01-021-1/+2
| | | | | | | | | | | | ...otherwise 4294967295 is not a valid value on 32bit systems
| * | lib: address type-punned pointers in prefix_same()Denis Ovsienko2012-01-021-2/+2
| | | | | | | | | | | | | | | | | | IPV4_ADDR_SAME() wasn't passed the right union member, this could cause a bug due to strict-aliasing. IPV6_ADDR_SAME() case got its fix before the error could be created by macro upgrade.
| * | bgpd: justify checks for IPv4 class D/EDenis Ovsienko2012-01-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/prefix.h * IPV4_CLASS_DE(): make consistent with counterpart macros * bgp_packet.c * bgp_open_receive(): test using macro instead of ">=" * bgp_route.c * bgp_update_rsclient(): idem * bgp_update_main(): idem
| * | zebra: ZEBRA_HELLO and mopping up routes (BZ#448)Vyacheslav Trushkin2012-01-022-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | ZEBRA_HELLO message is used by routing daemons to inform zebra what type of routes daemon will be announcing to zebra. Also zebra uses route_type_oaths array to track which daemon announces which protocol. Zebra mops up routes if daemon didn't for some reason.
| * | lib: fix type-punning in ip_masklen()Denis Ovsienko2012-01-021-2/+7
| | | | | | | | | | | | | | | ip_masklen() was likely to return incorrect results after being compiled with -fstrict-aliasing (-O2, -O3, -Os)
| * | lib: optimize ip_masklen()Denis Ovsienko2012-01-021-25/+2076
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new implementation makes use of a 64KB mapping table, which makes it possible to compute masklen faster and with constant execution time. The map also allows for additional version of the function, which can detect errors in input argument. The previous implementation had a variable cost of execution, which depended on masklen in a non-linear manner, and at its worst (/31) was 4 times slower, than the new implementation. The only case of old function just slightly outperforming the new one is /0, which is of little practical interest.
| * | Revert "lib: optimize apply_mask_ipv6()"Denis Ovsienko2012-01-011-7/+17
| | | | | | | | | | | | | | | Experience with IPv4 counterpart of this function suggests, that this way of type-punning is likely to cause errors.
| * | fix set never used warningsStephen Hemminger2011-12-184-24/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (This patch was modified to leave calls to stream_getl() in place, they are necessary for the stream's internal pointer to advance to the correct position. -- Denis) Signed-off-by: Denis Ovsienko <infrastation@yandex.ru> Fix gcc warnings about varables that are set but never used. * bgpd/bgp_attr.c * cluster_unintern(): ret * transit_unintern(): ret * bgp_attr_default_intern(): attre * bgp_mp_reach_parse(): rd_high, rd_low * bgpd/bgp_route.c * bgp_announce_check_rsclient(): bgp * bgpd/bgp_zebra.c * zebra_read_ipv4(): ifindex * zebra_read_ipv6(): ifindex * bgpd/bgpd.c * bgp_config_write_peer(): filter * lib/distribute.c * distribute_list_all(): dist * distribute_list(): dist * distribute_list_prefix_all(): dist * distribute_list_prefix(): dist * lib/if_rmap.c * if_rmap(): if_rmap * lib/vty.c * vty_accept(): vty * lib/zclient.c * zclient_read(): ret * zebra/irdp_interface.c * if_group(): zi * zebra/rt_netlink.c * kernel_read(): ret, sock
| * | lib: optimize apply_mask_ipv6()Denis Ovsienko2011-12-131-17/+7
| | |
| * | lib: optimize apply_mask_ipv4()Denis Ovsienko2011-12-131-18/+3
| | |
| * | lib: make masklen2ip6() safer and fasterDenis Ovsienko2011-12-132-17/+136
| | |
| * | lib: fix endianness of masklen2ip()Denis Ovsienko2011-12-131-3/+39
| | |
| * | lib: make masklen2ip() safer and fasterDenis Ovsienko2011-12-132-17/+40
| | |
| * | lib: spellingDenis Ovsienko2011-12-131-10/+10
| | |
| * | lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter2011-12-133-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | getaddrinfo returns a list of socket parameters for listening. it will contain both IPv4 and IPv6 listening sockets. unless we use IPV6_V6ONLY on the IPv6 ones, only the socket listed first will work. if the IPv4 one came first, the IPv6 one would get an "Address in use" error. this functionality was already present for bgpd and its listening sockets. as it is needed for vtys as well, make it a common helper. Conflicts: lib/sockunion.c
| * | lib: put route_types.txt to real useDavid Lamparter2011-12-136-229/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | build: delete .cvsignore filesDenis Ovsienko2011-12-131-14/+0
| | |
| * | lib: clearing zclient.c for some cases of buildingVyacheslav Trushkin2011-12-131-1/+3
| | | | | | | | | | | | | | | lib/zclient.c: using of HAVE_TCP_ZEBRA in zclient_socket_* definitions extended by else clause.
| * | quagga: option "-z" ("--socket <path>") addedVyacheslav Trushkin2011-12-132-14/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified.
| * | lib: fix SMUX compiler warningsStephen Hemminger2011-12-071-4/+3
| | | | | | | | | | | | | | | Make progname a string, and cast when calling asn1. Remove variable set but never used.
| * | lib: fix compile warnings from set-never-usedStephen Hemminger2011-12-071-6/+0
| | | | | | | | | | | | The if_dump code had empty loop, that caused set-never-used warning.
| * | vty_serv_sock_family unusedStephen Hemminger2011-12-071-1/+2
| | | | | | | | | | | | | | | If the vty_serv_sock_addrinfo is being used, then vty_serv_sock_family is unsed. Fix by adjusting ifdef/else/endif
| * | lib: fix memory leak on connect() failureStephen Hemminger2011-12-061-12/+11
| | | | | | | | | | | | | | | Change sockunion_log() to not use strdup(). This fixes a small memory leak that occurs on every failed connect(), and is simpler/cleaner.
| * | lib: call filter delete hook before freeing access listStephen Hemminger2011-12-061-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The delete_hook was being run after calling access list delete function. This would cause ospf to dereference a NULL, in ospf_filter_update because 'access->name' was already freed. See also: https://bugzilla.vyatta.com/show_bug.cgi?id=7654
| * | lib: prefix2sockunion, prefix_common_bits helper functionsDavid Lamparter2011-11-212-0/+56
| | | | | | | | | | | | | | | | | | prefix2sockunion converts a struct prefix* to a union sockunion *; prefix_common_bits counts the number of common bits in the prefix's address part.
| * | lib: compile even without IPV6_TCLASSDenis Ovsienko2011-10-171-1/+3
| | |
| * | IPv6 transport class suppportStephen Hemminger2011-10-172-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IPv6 supports the same concept of differentiated service for routing protocols as IPv4, but like too many things, the standards committee decided that having two names for the same thing wasn't good enough and introduced a third more generic term transport class. The socket option to set transport class works the same as IPv4, but the arguments are different. * lib/sockopt.[ch] * setsockopt_ipv6_tclass(): new function * bgpd/bgp_network.c * bgp_connect(): set socket option * bgp_listener(): set socket option * ospf6d/ospf6_network.c * ospf6_set_transport_class(): new function * ospf6_serv_sock(): set socket option * ripngd/ripngd.c * ripng_make_socket(): set socket option
| * | bgpd: improve NEXT_HOP attribute checks (BZ#680)Denis Ovsienko2011-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/prefix.h * IPV4_CLASS_DE(): new helper macro * bgp_attr.c * bgp_attr_nexthop(): add check for "partial" bit, refresh flag error reporting, explain meaning of RFC4271 section 6.3 and implement it Conflicts: bgpd/bgp_attr.c