]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_bmp.h
Merge pull request #12837 from donaldsharp/unlikely_routemap
[mirror_frr.git] / bgpd / bgp_bmp.h
index 2c3ba570ee24f30132930bab63e5b9d7ddc0ff6b..ab7463fadcad9c2338198e2d82dc13e76341112e 100644 (file)
@@ -1,20 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /* BMP support.
  * Copyright (C) 2018 Yasuhiro Ohara
  * Copyright (C) 2019 David Lamparter for NetDEF, Inc.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #ifndef _BGP_BMP_H_
@@ -66,8 +53,8 @@
  * always happens from the front of the queue.)
  */
 
-PREDECL_DLIST(bmp_qlist)
-PREDECL_HASH(bmp_qhash)
+PREDECL_DLIST(bmp_qlist);
+PREDECL_HASH(bmp_qhash);
 
 struct bmp_queue_entry {
        struct bmp_qlist_item bli;
@@ -92,7 +79,7 @@ struct bmp_queue_entry {
  * with a size limit.  Refcount works the same as for monitoring above.
  */
 
-PREDECL_LIST(bmp_mirrorq)
+PREDECL_LIST(bmp_mirrorq);
 
 struct bmp_mirrorq {
        struct bmp_mirrorq_item bmi;
@@ -112,7 +99,7 @@ enum {
        BMP_AFI_LIVE,
 };
 
-PREDECL_LIST(bmp_session)
+PREDECL_LIST(bmp_session);
 
 struct bmp_active;
 struct bmp_targets;
@@ -125,7 +112,7 @@ struct bmp {
 
        int socket;
        char remote[SU_ADDRSTRLEN + 6];
-       struct thread *t_read;
+       struct event *t_read;
 
        struct pullwr *pullwr;
 
@@ -166,7 +153,7 @@ struct bmp {
  * succeeds, "bmp" is set up.
  */
 
-PREDECL_SORTLIST_UNIQ(bmp_actives)
+PREDECL_SORTLIST_UNIQ(bmp_actives);
 
 #define BMP_DFLT_MINRETRY      30000
 #define BMP_DFLT_MAXRETRY      720000
@@ -179,6 +166,8 @@ struct bmp_active {
        char *hostname;
        int port;
        unsigned minretry, maxretry;
+       char *ifsrc;
+       union sockunion addrsrc;
 
        struct resolver_query resq;
 
@@ -187,11 +176,11 @@ struct bmp_active {
        union sockunion addrs[8];
        int socket;
        const char *last_err;
-       struct thread *t_timer, *t_read, *t_write;
+       struct event *t_timer, *t_read, *t_write;
 };
 
 /* config & state for passive / listening sockets */
-PREDECL_SORTLIST_UNIQ(bmp_listeners)
+PREDECL_SORTLIST_UNIQ(bmp_listeners);
 
 struct bmp_listener {
        struct bmp_listeners_item bli;
@@ -201,7 +190,7 @@ struct bmp_listener {
        union sockunion addr;
        int port;
 
-       struct thread *t_accept;
+       struct event *t_accept;
        int sock;
 };
 
@@ -209,7 +198,7 @@ struct bmp_listener {
  * bmp_active items.  If they have the same config, BMP session should be
  * put in the same targets since that's a bit more effective.
  */
-PREDECL_SORTLIST_UNIQ(bmp_targets)
+PREDECL_SORTLIST_UNIQ(bmp_targets);
 
 struct bmp_targets {
        struct bmp_targets_item bti;
@@ -237,7 +226,7 @@ struct bmp_targets {
 
        struct bmp_actives_head actives;
 
-       struct thread *t_stats;
+       struct event *t_stats;
        struct bmp_session_head sessions;
 
        struct bmp_qhash_head updhash;
@@ -245,13 +234,13 @@ struct bmp_targets {
 
        uint64_t cnt_accept, cnt_aclrefused;
 
-       QOBJ_FIELDS
+       QOBJ_FIELDS;
 };
-DECLARE_QOBJ_TYPE(bmp_targets)
+DECLARE_QOBJ_TYPE(bmp_targets);
 
 /* per struct peer * data.  Lookup by peer->qobj_node.nid, created on demand,
  * deleted in peer_backward hook. */
-PREDECL_HASH(bmp_peerh)
+PREDECL_HASH(bmp_peerh);
 
 struct bmp_bgp_peer {
        struct bmp_peerh_item bpi;
@@ -267,7 +256,7 @@ struct bmp_bgp_peer {
 };
 
 /* per struct bgp * data */
-PREDECL_HASH(bmp_bgph)
+PREDECL_HASH(bmp_bgph);
 
 #define BMP_PEER_DOWN_NO_RELEVANT_EVENT_CODE 0x00
 
@@ -309,6 +298,6 @@ enum {
        BMP_STATS_FRR_NH_INVALID        = 65531,
 };
 
-DECLARE_MGROUP(BMP)
+DECLARE_MGROUP(BMP);
 
 #endif /*_BGP_BMP_H_*/