summaryrefslogtreecommitdiffstats
path: root/lib/sockunion.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* lib: add `%dPF` & `%dSO` formatsDavid Lamparter2021-03-301-0/+5
| | | | | | Just quick helpers to print `AF_*` and `SOCK_*` constants. Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: fix & improve `%pSU` formatDavid Lamparter2021-03-301-0/+7
| | | | | | | | This wasn't quite formatting IPv6+port in a useful way (no brackets), and printing the scope ID (interface index) and unix addrs is useful too. Signed-off-by: David Lamparter <equinox@diac24.net>
* libs,nhrpd: remove exec permMark Stapp2021-01-121-0/+0
| | | | | | | Some source files got the exec bit set in a recent commit - undo that. Signed-off-by: Mark Stapp <mjs@voltanet.io>
* nhrpd: Clear shortcut routes properly for all protocolsGaurav Goyal2020-12-161-0/+1
| | | | | | | | | | | | Currently when nhrp shortcuts are purged they will not be recreated. This patch fixes that by ensuring the shortcut routes get purged correctly. This situation can be reproduced by first allowing a shortcut to be created then clearing the shortcut: clear ip nhrp cache clear ip nhrp shortcuts Signed-off-by: Reuben Dowle <reuben.dowle@4rf.com>
* lib: add %pSU for union sockunion *David Lamparter2020-07-141-0/+4
| | | | Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd, lib: Remove SO_MARKDonald Sharp2019-05-241-1/+0
| | | | | | | | | | | | The SO_MARK socket option was being used pre vrf to allow for the separation of the front panel -vs- the management port. This was facilitated by a ip rule. Since this is undocumented anywhere in our system( other than old commits see ed40466af80c9d0b88436c637a1d54b28a669b1c ). We should remove this because this will cause interference with people using rules and are not aware of this offshoot of functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* vrrpd: ipv6 supportQuentin Young2019-05-171-0/+1
| | | | | | Add initial support for IPv6. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* lib: add extern "C" {} blocks to all libfrr headersRenato Westphal2019-02-121-0/+8
| | | | | | | These are necessary to use functions defined in these headers from C++. Signed-off-by: David Lamparter <equinox@diac24.net> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: kernel_socket: read extra attributesDavid Lamparter2017-08-281-0/+1
| | | | | | This is just to silence the "didn't read all data" warning. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: reindentreindent-master-afterwhitespace / reindent2017-07-171-44/+38
| | | | | | indent.py `git ls-files | pcregrep '\.[ch]$' | pcregrep -v '^(ldpd|babeld|nhrpd)/'` Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* *: make consistent & update GPLv2 file headersDavid Lamparter2017-05-151-4/+3
| | | | | | | | | | | The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* frr: Remove HAVE_IPV6 from code baseDonald Sharp2017-01-131-4/+0
| | | | Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* build: massively remove needless checksDavid Lamparter2016-11-151-13/+0
| | | | | | | | | | Since we have autoconf results from a wide swath of target platforms, we can go remove checks that have the same result on all systems. This also removes several "fallback" implementations of functions that, at some point in the history, weren't available on all target platforms. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* zebra: check at startup if the kernel supports MPLSRenato Westphal2016-09-231-2/+2
| | | | | | | | Replace all HAVE_MPLS #ifdef's by a run-time check if MPLS is supported by the kernel or not. This way we don't need to create multiple packages for each OS distribution. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* mpls: add support to the OpenBSD kernelRenato Westphal2016-09-231-0/+6
| | | | Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
* *: use an ifindex_t type, defined in lib/if.h, for ifindex valuesPaul Jakma2016-08-181-1/+2
| | | | (cherry picked from commit 9099f9b2a66e86f8a90d7fe18f61bd2bb1bc6744)
* lib: constify sockunion apiTimo Teräs2016-06-081-6/+6
| | | | | | | | Add const to read-only api calls. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 81b139bdd530adda045d22a4daf0054b89703dab)
* sockunion: add accessors for sockunion addressTimo Teräs2016-05-261-0/+5
| | | | | | | | | Upcoming nhrp code will use this, and it can be used to remove the sockunion2ip(X) macro. Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org> (cherry picked from commit 483abc037b0ac4b3ed168c4810bb14ea338fa80c)
* lib: Fix some more compiler warningsDonald Sharp2016-05-201-17/+0
| | | | | | | | | | | | | | | Three different changes: a) in nexthop.c we have an actual bug, we've rearranged the enumerated types and the list of enums has changed, we were displaying the wrong nexthop information. b) Remove some dead code from sockunion.h c) '\0' evaluates to 0 which is NULL. vector_set takes a pointer. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com> Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
* Use a hash to store BGP peer structuresDaniel Walton2015-10-231-0/+1
| | | | | | | Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-5370
* sockunion: add hash functionTimo Teräs2015-09-081-0/+1
| | | | | Signed-off-by: Timo Teräs <timo.teras@iki.fi> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
* bgpd-set-somark.patchDonald Sharp2015-06-121-0/+3
| | | | | | | | | | | | | BGP: Set SO_MARK on connecting sockets to ensure lookup in right routing table In the presence of a function such as management VRF/MRF, bgpd needs to be able to specify that it intends to run in the dataplane and not the front panel. To ensure this, we add a mark in the connecting socket so that the kernel does the routing lookup in the right table. This assumes that an appropriate ip rule has been configured (outside the scope of this package). While we've forced the mark to be 254 for now, it maybe required to make it configurable at a later time.
* BGP: Add dynamic update group supportDonald Sharp2015-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | This patch implements the 'update-groups' functionality in BGP. This is a function that can significantly improve BGP performance for Update generation and resultant network convergence. BGP Updates are formed for "groups" of peers and then replicated and sent out to each peer rather than being formed for each peer. Thus major BGP operations related to outbound policy application, adj-out maintenance and actual Update packet formation are optimized. BGP update-groups dynamically groups peers together based on configuration as well as run-time criteria. Thus, it is more flexible than update-formation based on peer-groups, which relies on operator configuration. [Note that peer-group based update formation has been introduced into BGP by Cumulus but is currently intended only for specific releases.] From 11098af65b2b8f9535484703e7f40330a71cbae4 Mon Sep 17 00:00:00 2001 Subject: [PATCH] updgrp commits
* lib: Add back sockunion_str2suPaul Jakma2012-06-141-0/+1
| | | | | | * sockunion.h: Add back sockunion_str2su, its removal breaks things needlessly (e.g. our own unit tests). * sockunion.c: (sockunion_str2su) implement on top of str2sockunion.
* lib: remove sockunion related unused definitionsJorge Boncompte [DTI2]2012-05-021-7/+0
| | | | | Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd: Fix memory leak of some "show ip bgp neighbor" commandsJorge Boncompte [DTI2]2012-05-021-1/+0
| | | | | | | | | | | | sockunion_str2su() use is prone to memory leaks. Remove it's use all over the code. At least these commands leaked a sockunion union: - show ip bgp vpnv4 ... routes - show ip bgp ... received prefix-filter Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: remove last uses of sockunion_su2str()Jorge Boncompte [DTI2]2012-05-021-1/+0
| | | | | | | | | Use of this function is prone to memory leaks. This fixes a memory accounting bug for vty denied connections. Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David Lamparter <equinox@diac24.net>
* bgpd: Fix memory leak with 'set ip next-hop peer-address'Jorge Boncompte [DTI2]2012-05-021-0/+2
| | | | | | | | A route-map with the mentioned statement causes a memory leak for every prefix that matches. Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net> Signed-off-by: David Lamparter <equinox@diac24.net>
* lib: add sockopt helper for setting IPV6_V6ONLY and use itDavid Lamparter2011-12-131-0/+1
| | | | | | | | | | | | | | | 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
* bgpd: RFC 5082 Generalized TTL Security Mechanism supportNick Hilliard2011-03-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * bgpd: Add support for RFC 5082 GTSM, which allows the TTL field to be used to verify that incoming packets have been sent from neighbours no more than X IP hops away. In other words, this allows packets that were sent from further away (i.e. not by the neighbour with known distance, and so possibly a miscreant) to be filtered out. * lib/sockunion.{c,h}: (sockopt_minttl) new function, to set a minimum TTL using the IP_MINTTL socket opt. * bgpd.h: (BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK) define for command error for minttl. (struct peer) add a config variable, to store the configured minttl. (peer_ttl_security_hops_{set,unset}) configuration handlers * bgpd.c: (peer_group_get) init gtsm_hops (peer_ebgp_multihop_{un,}set) check for conflicts with GTSM. Multihop and GTSM can't both be active for a peer at the same time. (peer_ttl_security_hops_set) set minttl, taking care to avoid conflicts with ebgp_multihop. (bgp_config_write_peer) write out minttl as "neighbor .. ttl-security hops X". * bgp_vty.c: (bgp_vty_return) message for BGP_ERR_NO_EBGP_MULTIHOP_WITH_TTLHACK (peer_ebgp_multihop_{un,}set_vty) * bgp_network.c: (bgp_accept) set minttl on accepted sockets if appropriate. (bgp_connect) ditto for outbound.
* lib: add TCP_CORK wrapperStephen Hemminger2011-03-211-0/+1
| | | | | * sockunion.{c,h}: (sockopt_cork) wrapper for TCP_CORK socket option for those platforms that provide it. For other platforms, it is just a nop.
* 2005-05-06 Paul Jakma <paul@dishone.st>paul2005-05-061-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | * (general) extern and static'ification of functions in code and header. Cleanup any definitions with unspecified arguments. Add casts for callback assignments where the callback is defined, typically, as passing void *, but the function being assigned has some other pointer type defined as its argument, as gcc complains about casts from void * to X* via function arguments. Fix some old K&R style function argument definitions. Add noreturn gcc attribute to some functions, as appropriate. Add unused gcc attribute to some functions (eg ones meant to help while debugging) Add guard defines to headers which were missing them. * command.c: (install_node) add const qualifier, still doesnt shut up the warning though, because of the double pointer. (cmp_node) ditto * keychain.c: (key_str2time) Add GET_LONG_RANGE() macro, derived fromn vty.h ones to fix some of the (long) < 0 warnings. * thread.c: (various) use thread_empty (cpu_record_hash_key) should cast to uintptr_t, a stdint.h type * vty.h: Add VTY_GET_IPV4_ADDRESS and VTY_GET_IPV4_PREFIX so they removed from ospfd/ospf_vty.h * zebra.h: Move definition of ZEBRA_PORT to here, to remove dependence of lib on zebra/zserv.h
* 2004-10-13 Paul Jakma <paul@dishone.st>paul2004-10-131-1/+1
| | | | | | | | | | | | | * (global) more const'ification. * sockunion.c: (sockunion_su2str) buffer should be sized SU_ADDRSTRLEN. (sockunion_log) do not return stack variables, strdup buf before return. * vty.h: Fix up the VTY_GET_INTEGER macros. Testing caller supplied values against ULONG_MAX is daft, when caller probably has passed a type that can not hold ULONG_MAX. use a temporary long instead. Add VTY_GET_LONG, make VTY_GET_INTEGER_RANGE use it, make VTY_GET_INTEGER a define for VTY_GET_INTEGER_RANGE.
* Some more const string fixes.hasso2004-10-111-1/+1
|
* Initial revisionpaul2002-12-131-0/+128