summaryrefslogtreecommitdiffstats
path: root/nhrpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-12-25 16:26:52 +0100
committerDonald Sharp <sharpd@nvidia.com>2023-03-24 13:32:17 +0100
commite16d030c65ca97b1ba68b93ada93b1d4edde59d3 (patch)
treee3a57a2e2887a899cad71c0640047b2b2409b5fa /nhrpd
parentlib, zebra: Convert THREAD_TIMER_STRLEN to EVENT_TIMER_STRLEN (diff)
downloadfrr-e16d030c65ca97b1ba68b93ada93b1d4edde59d3.tar.xz
frr-e16d030c65ca97b1ba68b93ada93b1d4edde59d3.zip
*: Convert THREAD_XXX macros to EVENT_XXX macros
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'nhrpd')
-rw-r--r--nhrpd/netlink_arp.c2
-rw-r--r--nhrpd/nhrp_cache.c14
-rw-r--r--nhrpd/nhrp_event.c10
-rw-r--r--nhrpd/nhrp_multicast.c4
-rw-r--r--nhrpd/nhrp_nhs.c14
-rw-r--r--nhrpd/nhrp_packet.c2
-rw-r--r--nhrpd/nhrp_peer.c14
-rw-r--r--nhrpd/nhrp_shortcut.c14
-rw-r--r--nhrpd/vici.c10
9 files changed, 42 insertions, 42 deletions
diff --git a/nhrpd/netlink_arp.c b/nhrpd/netlink_arp.c
index c929f6680..845d454d1 100644
--- a/nhrpd/netlink_arp.c
+++ b/nhrpd/netlink_arp.c
@@ -99,7 +99,7 @@ static void netlink_log_indication(struct nlmsghdr *msg, struct zbuf *zb)
static void netlink_log_recv(struct event *t)
{
uint8_t buf[ZNL_BUFFER_SIZE];
- int fd = THREAD_FD(t);
+ int fd = EVENT_FD(t);
struct zbuf payload, zb;
struct nlmsghdr *n;
diff --git a/nhrpd/nhrp_cache.c b/nhrpd/nhrp_cache.c
index 8bc44f947..f41c0afc5 100644
--- a/nhrpd/nhrp_cache.c
+++ b/nhrpd/nhrp_cache.c
@@ -72,8 +72,8 @@ static void nhrp_cache_free(struct nhrp_cache *c)
hash_release(nifp->cache_hash, c);
nhrp_peer_unref(c->cur.peer);
nhrp_peer_unref(c->new.peer);
- THREAD_OFF(c->t_timeout);
- THREAD_OFF(c->t_auth);
+ EVENT_OFF(c->t_timeout);
+ EVENT_OFF(c->t_auth);
XFREE(MTYPE_NHRP_CACHE, c);
}
@@ -197,7 +197,7 @@ struct nhrp_cache *nhrp_cache_get(struct interface *ifp,
static void nhrp_cache_do_free(struct event *t)
{
- struct nhrp_cache *c = THREAD_ARG(t);
+ struct nhrp_cache *c = EVENT_ARG(t);
c->t_timeout = NULL;
nhrp_cache_free(c);
@@ -205,7 +205,7 @@ static void nhrp_cache_do_free(struct event *t)
static void nhrp_cache_do_timeout(struct event *t)
{
- struct nhrp_cache *c = THREAD_ARG(t);
+ struct nhrp_cache *c = EVENT_ARG(t);
c->t_timeout = NULL;
if (c->cur.type != NHRP_CACHE_INVALID)
@@ -310,7 +310,7 @@ static void nhrp_cache_peer_notifier(struct notifier_block *n,
static void nhrp_cache_reset_new(struct nhrp_cache *c)
{
- THREAD_OFF(c->t_auth);
+ EVENT_OFF(c->t_auth);
if (notifier_list_anywhere(&c->newpeer_notifier))
nhrp_peer_notify_del(c->new.peer, &c->newpeer_notifier);
nhrp_peer_unref(c->new.peer);
@@ -320,7 +320,7 @@ static void nhrp_cache_reset_new(struct nhrp_cache *c)
static void nhrp_cache_update_timers(struct nhrp_cache *c)
{
- THREAD_OFF(c->t_timeout);
+ EVENT_OFF(c->t_timeout);
switch (c->cur.type) {
case NHRP_CACHE_INVALID:
@@ -397,7 +397,7 @@ static void nhrp_cache_authorize_binding(struct nhrp_reqid *r, void *arg)
static void nhrp_cache_do_auth_timeout(struct event *t)
{
- struct nhrp_cache *c = THREAD_ARG(t);
+ struct nhrp_cache *c = EVENT_ARG(t);
c->t_auth = NULL;
nhrp_cache_authorize_binding(&c->eventid, (void *)"timeout");
}
diff --git a/nhrpd/nhrp_event.c b/nhrpd/nhrp_event.c
index 3bcd42691..59bb62d28 100644
--- a/nhrpd/nhrp_event.c
+++ b/nhrpd/nhrp_event.c
@@ -31,8 +31,8 @@ static void evmgr_reconnect(struct event *t);
static void evmgr_connection_error(struct event_manager *evmgr)
{
- THREAD_OFF(evmgr->t_read);
- THREAD_OFF(evmgr->t_write);
+ EVENT_OFF(evmgr->t_read);
+ EVENT_OFF(evmgr->t_write);
zbuf_reset(&evmgr->ibuf);
zbufq_reset(&evmgr->obuf);
@@ -76,7 +76,7 @@ static void evmgr_recv_message(struct event_manager *evmgr, struct zbuf *zb)
static void evmgr_read(struct event *t)
{
- struct event_manager *evmgr = THREAD_ARG(t);
+ struct event_manager *evmgr = EVENT_ARG(t);
struct zbuf *ibuf = &evmgr->ibuf;
struct zbuf msg;
@@ -94,7 +94,7 @@ static void evmgr_read(struct event *t)
static void evmgr_write(struct event *t)
{
- struct event_manager *evmgr = THREAD_ARG(t);
+ struct event_manager *evmgr = EVENT_ARG(t);
int r;
r = zbufq_write(&evmgr->obuf, evmgr->fd);
@@ -181,7 +181,7 @@ static void evmgr_submit(struct event_manager *evmgr, struct zbuf *obuf)
static void evmgr_reconnect(struct event *t)
{
- struct event_manager *evmgr = THREAD_ARG(t);
+ struct event_manager *evmgr = EVENT_ARG(t);
int fd;
if (evmgr->fd >= 0 || !nhrp_event_socket_path)
diff --git a/nhrpd/nhrp_multicast.c b/nhrpd/nhrp_multicast.c
index 759dbd1b9..71f27ac21 100644
--- a/nhrpd/nhrp_multicast.c
+++ b/nhrpd/nhrp_multicast.c
@@ -141,7 +141,7 @@ static void netlink_mcast_log_handler(struct nlmsghdr *msg, struct zbuf *zb)
static void netlink_mcast_log_recv(struct event *t)
{
uint8_t buf[65535]; /* Max OSPF Packet size */
- int fd = THREAD_FD(t);
+ int fd = EVENT_FD(t);
struct zbuf payload, zb;
struct nlmsghdr *n;
@@ -190,7 +190,7 @@ static void netlink_mcast_log_register(int fd, int group)
void netlink_mcast_set_nflog_group(int nlgroup)
{
if (netlink_mcast_log_fd >= 0) {
- THREAD_OFF(netlink_mcast_log_thread);
+ EVENT_OFF(netlink_mcast_log_thread);
close(netlink_mcast_log_fd);
netlink_mcast_log_fd = -1;
debugf(NHRP_DEBUG_COMMON, "De-register nflog group");
diff --git a/nhrpd/nhrp_nhs.c b/nhrpd/nhrp_nhs.c
index 9ffb0c095..063e7bbf8 100644
--- a/nhrpd/nhrp_nhs.c
+++ b/nhrpd/nhrp_nhs.c
@@ -88,7 +88,7 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
/* Success - schedule next registration, and route NHS */
r->timeout = 2;
holdtime = nifp->afi[nhs->afi].holdtime;
- THREAD_OFF(r->t_register);
+ EVENT_OFF(r->t_register);
/* RFC 2332 5.2.3 - Registration is recommend to be renewed
* every one third of holdtime */
@@ -105,7 +105,7 @@ static void nhrp_reg_reply(struct nhrp_reqid *reqid, void *arg)
static void nhrp_reg_timeout(struct event *t)
{
- struct nhrp_registration *r = THREAD_ARG(t);
+ struct nhrp_registration *r = EVENT_ARG(t);
struct nhrp_cache *c;
@@ -148,7 +148,7 @@ static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd)
case NOTIFY_PEER_MTU_CHANGED:
debugf(NHRP_DEBUG_COMMON, "NHS: Flush timer for %pSU",
&r->peer->vc->remote.nbma);
- THREAD_OFF(r->t_register);
+ EVENT_OFF(r->t_register);
event_add_timer_msec(master, nhrp_reg_send_req, r, 10,
&r->t_register);
break;
@@ -157,7 +157,7 @@ static void nhrp_reg_peer_notify(struct notifier_block *n, unsigned long cmd)
static void nhrp_reg_send_req(struct event *t)
{
- struct nhrp_registration *r = THREAD_ARG(t);
+ struct nhrp_registration *r = EVENT_ARG(t);
struct nhrp_nhs *nhs = r->nhs;
struct interface *ifp = nhs->ifp;
struct nhrp_interface *nifp = ifp->info;
@@ -244,7 +244,7 @@ static void nhrp_reg_delete(struct nhrp_registration *r)
nhrp_peer_notify_del(r->peer, &r->peer_notifier);
nhrp_peer_unref(r->peer);
nhrp_reglist_del(&r->nhs->reglist_head, r);
- THREAD_OFF(r->t_register);
+ EVENT_OFF(r->t_register);
XFREE(MTYPE_NHRP_REGISTRATION, r);
}
@@ -311,7 +311,7 @@ static void nhrp_nhs_resolve_cb(struct resolver_query *q, const char *errstr,
static void nhrp_nhs_resolve(struct event *t)
{
- struct nhrp_nhs *nhs = THREAD_ARG(t);
+ struct nhrp_nhs *nhs = EVENT_ARG(t);
resolver_resolve(&nhs->dns_resolve, AF_INET, VRF_DEFAULT,
nhs->nbma_fqdn, nhrp_nhs_resolve_cb);
@@ -383,7 +383,7 @@ int nhrp_nhs_free(struct nhrp_interface *nifp, afi_t afi, struct nhrp_nhs *nhs)
frr_each_safe (nhrp_reglist, &nhs->reglist_head, r)
nhrp_reg_delete(r);
- THREAD_OFF(nhs->t_resolve);
+ EVENT_OFF(nhs->t_resolve);
nhrp_nhslist_del(&nifp->afi[afi].nhslist_head, nhs);
free((void *)nhs->nbma_fqdn);
XFREE(MTYPE_NHRP_NHS, nhs);
diff --git a/nhrpd/nhrp_packet.c b/nhrpd/nhrp_packet.c
index 6502cff51..3366a64b4 100644
--- a/nhrpd/nhrp_packet.c
+++ b/nhrpd/nhrp_packet.c
@@ -288,7 +288,7 @@ err:
static void nhrp_packet_recvraw(struct event *t)
{
- int fd = THREAD_FD(t), ifindex;
+ int fd = EVENT_FD(t), ifindex;
struct zbuf *zb;
struct interface *ifp;
struct nhrp_peer *p;
diff --git a/nhrpd/nhrp_peer.c b/nhrpd/nhrp_peer.c
index 9ca7b8441..f41a7d314 100644
--- a/nhrpd/nhrp_peer.c
+++ b/nhrpd/nhrp_peer.c
@@ -43,8 +43,8 @@ static void nhrp_peer_check_delete(struct nhrp_peer *p)
debugf(NHRP_DEBUG_COMMON, "Deleting peer ref:%d remote:%pSU local:%pSU",
p->ref, &p->vc->remote.nbma, &p->vc->local.nbma);
- THREAD_OFF(p->t_fallback);
- THREAD_OFF(p->t_timer);
+ EVENT_OFF(p->t_fallback);
+ EVENT_OFF(p->t_timer);
hash_release(nifp->peer_hash, p);
nhrp_interface_notify_del(p->ifp, &p->ifp_notifier);
nhrp_vc_notify_del(p->vc, &p->vc_notifier);
@@ -53,7 +53,7 @@ static void nhrp_peer_check_delete(struct nhrp_peer *p)
static void nhrp_peer_notify_up(struct event *t)
{
- struct nhrp_peer *p = THREAD_ARG(t);
+ struct nhrp_peer *p = EVENT_ARG(t);
struct nhrp_vc *vc = p->vc;
struct interface *ifp = p->ifp;
struct nhrp_interface *nifp = ifp->info;
@@ -76,7 +76,7 @@ static void __nhrp_peer_check(struct nhrp_peer *p)
online = nifp->enabled && (!nifp->ipsec_profile || vc->ipsec);
if (p->online != online) {
- THREAD_OFF(p->t_fallback);
+ EVENT_OFF(p->t_fallback);
if (online && notifier_active(&p->notifier_list)) {
/* If we requested the IPsec connection, delay
* the up notification a bit to allow things
@@ -250,7 +250,7 @@ void nhrp_peer_unref(struct nhrp_peer *p)
static void nhrp_peer_request_timeout(struct event *t)
{
- struct nhrp_peer *p = THREAD_ARG(t);
+ struct nhrp_peer *p = EVENT_ARG(t);
struct nhrp_vc *vc = p->vc;
struct interface *ifp = p->ifp;
struct nhrp_interface *nifp = ifp->info;
@@ -273,12 +273,12 @@ static void nhrp_peer_request_timeout(struct event *t)
static void nhrp_peer_defer_vici_request(struct event *t)
{
- struct nhrp_peer *p = THREAD_ARG(t);
+ struct nhrp_peer *p = EVENT_ARG(t);
struct nhrp_vc *vc = p->vc;
struct interface *ifp = p->ifp;
struct nhrp_interface *nifp = ifp->info;
- THREAD_OFF(p->t_timer);
+ EVENT_OFF(p->t_timer);
if (p->online) {
debugf(NHRP_DEBUG_COMMON,
diff --git a/nhrpd/nhrp_shortcut.c b/nhrpd/nhrp_shortcut.c
index 838fac752..5a141022d 100644
--- a/nhrpd/nhrp_shortcut.c
+++ b/nhrpd/nhrp_shortcut.c
@@ -33,7 +33,7 @@ static void nhrp_shortcut_check_use(struct nhrp_shortcut *s)
static void nhrp_shortcut_do_expire(struct event *t)
{
- struct nhrp_shortcut *s = THREAD_ARG(t);
+ struct nhrp_shortcut *s = EVENT_ARG(t);
event_add_timer(master, nhrp_shortcut_do_purge, s, s->holding_time / 3,
&s->t_timer);
@@ -123,7 +123,7 @@ static void nhrp_shortcut_update_binding(struct nhrp_shortcut *s,
s->route_installed = 0;
}
- THREAD_OFF(s->t_timer);
+ EVENT_OFF(s->t_timer);
if (holding_time) {
s->expiring = 0;
s->holding_time = holding_time;
@@ -137,7 +137,7 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s)
struct route_node *rn;
afi_t afi = family2afi(PREFIX_FAMILY(s->p));
- THREAD_OFF(s->t_timer);
+ EVENT_OFF(s->t_timer);
nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
debugf(NHRP_DEBUG_ROUTE, "Shortcut %pFX purged", s->p);
@@ -156,7 +156,7 @@ static void nhrp_shortcut_delete(struct nhrp_shortcut *s)
static void nhrp_shortcut_do_purge(struct event *t)
{
- struct nhrp_shortcut *s = THREAD_ARG(t);
+ struct nhrp_shortcut *s = EVENT_ARG(t);
s->t_timer = NULL;
nhrp_shortcut_delete(s);
}
@@ -204,7 +204,7 @@ static void nhrp_shortcut_recv_resolution_rep(struct nhrp_reqid *reqid,
int holding_time = pp->if_ad->holdtime;
nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
- THREAD_OFF(s->t_timer);
+ EVENT_OFF(s->t_timer);
event_add_timer(master, nhrp_shortcut_do_purge, s, 1, &s->t_timer);
if (pp->hdr->type != NHRP_PACKET_RESOLUTION_REPLY) {
@@ -454,7 +454,7 @@ void nhrp_shortcut_initiate(union sockunion *addr)
s = nhrp_shortcut_get(&p);
if (s && s->type != NHRP_CACHE_INCOMPLETE) {
s->addr = *addr;
- THREAD_OFF(s->t_timer);
+ EVENT_OFF(s->t_timer);
event_add_timer(master, nhrp_shortcut_do_purge, s, 30,
&s->t_timer);
nhrp_shortcut_send_resolution_req(s);
@@ -499,7 +499,7 @@ struct purge_ctx {
void nhrp_shortcut_purge(struct nhrp_shortcut *s, int force)
{
- THREAD_OFF(s->t_timer);
+ EVENT_OFF(s->t_timer);
nhrp_reqid_free(&nhrp_packet_reqid, &s->reqid);
if (force) {
diff --git a/nhrpd/vici.c b/nhrpd/vici.c
index 67a7877b6..c72f3a86f 100644
--- a/nhrpd/vici.c
+++ b/nhrpd/vici.c
@@ -70,8 +70,8 @@ static void vici_connection_error(struct vici_conn *vici)
{
nhrp_vc_reset();
- THREAD_OFF(vici->t_read);
- THREAD_OFF(vici->t_write);
+ EVENT_OFF(vici->t_read);
+ EVENT_OFF(vici->t_write);
zbuf_reset(&vici->ibuf);
zbufq_reset(&vici->obuf);
@@ -359,7 +359,7 @@ static void vici_recv_message(struct vici_conn *vici, struct zbuf *msg)
static void vici_read(struct event *t)
{
- struct vici_conn *vici = THREAD_ARG(t);
+ struct vici_conn *vici = EVENT_ARG(t);
struct zbuf *ibuf = &vici->ibuf;
struct zbuf pktbuf;
@@ -389,7 +389,7 @@ static void vici_read(struct event *t)
static void vici_write(struct event *t)
{
- struct vici_conn *vici = THREAD_ARG(t);
+ struct vici_conn *vici = EVENT_ARG(t);
int r;
r = zbufq_write(&vici->obuf, vici->fd);
@@ -502,7 +502,7 @@ static char *vici_get_charon_filepath(void)
static void vici_reconnect(struct event *t)
{
- struct vici_conn *vici = THREAD_ARG(t);
+ struct vici_conn *vici = EVENT_ARG(t);
int fd;
char *file_path;