+// 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_
* 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;
* 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;
BMP_AFI_LIVE,
};
-PREDECL_LIST(bmp_session)
+PREDECL_LIST(bmp_session);
struct bmp_active;
struct bmp_targets;
int socket;
char remote[SU_ADDRSTRLEN + 6];
- struct thread *t_read;
+ struct event *t_read;
struct pullwr *pullwr;
* 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
char *hostname;
int port;
unsigned minretry, maxretry;
+ char *ifsrc;
+ union sockunion addrsrc;
struct resolver_query resq;
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;
union sockunion addr;
int port;
- struct thread *t_accept;
+ struct event *t_accept;
int sock;
};
* 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;
struct bmp_actives_head actives;
- struct thread *t_stats;
+ struct event *t_stats;
struct bmp_session_head sessions;
struct bmp_qhash_head updhash;
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;
};
/* per struct bgp * data */
-PREDECL_HASH(bmp_bgph)
+PREDECL_HASH(bmp_bgph);
#define BMP_PEER_DOWN_NO_RELEVANT_EVENT_CODE 0x00
BMP_STATS_FRR_NH_INVALID = 65531,
};
-DECLARE_MGROUP(BMP)
+DECLARE_MGROUP(BMP);
#endif /*_BGP_BMP_H_*/