MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tmproutes_update

Function tmproutes_update

freebsd/net/route/route_temporal.c:125–147  ·  view source on GitHub ↗

* Function responsible for updating the time of the next calllout * w.r.t. new temporal routes insertion. * * Called by the routing code upon adding new temporal route * to the tree. RIB_WLOCK must be held. */

Source from the content-addressed store, hash-verified

123 * to the tree. RIB_WLOCK must be held.
124 */
125void
126tmproutes_update(struct rib_head *rnh, struct rtentry *rt)
127{
128 int seconds;
129
130 RIB_WLOCK_ASSERT(rnh);
131
132 if (rnh->next_expire == 0 || rnh->next_expire > rt->rt_expire) {
133 /*
134 * Callback is not scheduled, is executing,
135 * or is scheduled for a later time than we need.
136 *
137 * Schedule the one for the current @rt expiration time.
138 */
139 seconds = (rt->rt_expire - time_uptime);
140 if (seconds < 0)
141 seconds = 0;
142 callout_reset_sbt(&rnh->expire_callout, SBT_1S * seconds,
143 SBT_1MS * 500, expire_callout, rnh, 0);
144
145 rnh->next_expire = rt->rt_expire;
146 }
147}
148
149void
150tmproutes_init(struct rib_head *rh)

Callers 2

add_route_nhopFunction · 0.85
change_route_nhopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected