/* SPDX-License-Identifier: GPL-2.0 */ /* * INETPEER - A storage for permanent information about peers * * Authors: Andrey V. Savochkin <saw@msu.ru>
*/
u32 metrics[RTAX_MAX];
u32 rate_tokens; /* rate limiting for ICMP */
u32 n_redirects; unsignedlong rate_last; /* * Once inet_peer is queued for deletion (refcnt == 0), following field * is not available: rid * We can share memory with rcu_head to help keep inet_peer small.
*/ union { struct {
atomic_t rid; /* Frag reception counter */
}; struct rcu_head rcu;
};
/* following fields might be frequently dirtied */
__u32 dtime; /* the time of last use of not referenced entries */
refcount_t refcnt;
};
/* can be called with or without local BH being disabled */ struct inet_peer *inet_getpeer(struct inet_peer_base *base, conststruct inetpeer_addr *daddr);
staticinlineint inetpeer_addr_cmp(conststruct inetpeer_addr *a, conststruct inetpeer_addr *b)
{ int i, n;
if (a->family == AF_INET)
n = sizeof(a->a4) / sizeof(u32); else
n = sizeof(a->a6) / sizeof(u32);
for (i = 0; i < n; i++) { if (a->key[i] == b->key[i]) continue; if (a->key[i] < b->key[i]) return -1; return 1;
}
return 0;
}
/* can be called from BH context or outside */ void inet_putpeer(struct inet_peer *p); bool inet_peer_xrlim_allow(struct inet_peer *peer, int timeout);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.