1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

Break long lines in code and comments.

This commit is contained in:
Gleb Smirnoff 2005-02-05 09:08:33 +00:00
parent 30aabc9afd
commit 020d3f61d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=141343

View File

@ -293,8 +293,8 @@ hash_insert(priv_p priv, int slot, struct flow_rec *r, int plen)
}
static __inline int
make_flow_rec(struct mbuf **m, int *plen, struct flow_rec *r, uint8_t *tcp_flags,
u_int16_t i_ifx)
make_flow_rec(struct mbuf **m, int *plen, struct flow_rec *r,
uint8_t *tcp_flags, u_int16_t i_ifx)
{
register struct ip *ip;
int hlen;
@ -469,7 +469,8 @@ ng_netflow_flow_add(priv_p priv, struct mbuf **m, iface_p iface)
/* Try to fill *rec */
bzero(&r, sizeof(r));
if ((error = make_flow_rec(m, &plen, &r, &tcp_flags, iface->info.ifinfo_index)))
if ((error = make_flow_rec(m, &plen, &r, &tcp_flags,
iface->info.ifinfo_index)))
return (error);
slot = ip_hash(&r);
@ -554,7 +555,8 @@ ng_netflow_flow_show(priv_p priv, uint32_t last, struct ng_mesg *resp)
for (; last < CACHESIZE; fle++, last++) {
if (ISFREE(fle))
continue;
bcopy(&fle->f, &(data->entries[data->nentries]), sizeof(fle->f));
bcopy(&fle->f, &(data->entries[data->nentries]),
sizeof(fle->f));
data->nentries ++;
if (data->nentries == NREC_AT_ONCE) {
if (++last < CACHESIZE)
@ -687,13 +689,14 @@ ng_netflow_expire(void *arg)
mtx_lock(&priv->work_mtx);
TAILQ_FOREACH_SAFE(fle, &(priv->work_queue), fle_work, fle1) {
/*
* When cache size has not reached CACHELOWAT yet, we keep both
* inactive and active flows in cache. Doing this, we reduce number
* of exports, since many inactive flows may wake up and continue
* their life. However, we make an exclusion for scans. It is very
* rare situation that inactive 1-packet flow will wake up.
* When cache has reached CACHELOWAT, we expire all inactive flows,
* until cache gets of sane size.
* When cache size has not reached CACHELOWAT yet, we keep
* both inactive and active flows in cache. Doing this, we
* reduce number of exports, since many inactive flows may
* wake up and continue their life. However, we make an
* exclusion for scans. It is very rare situation that
* inactive 1-packet flow will wake up.
* When cache has reached CACHELOWAT, we expire all inactive
* flows, until cache gets to a sane size.
*/
if (used <= CACHELOWAT && !INACTIVE(fle))
goto finish;
@ -707,10 +710,10 @@ ng_netflow_expire(void *arg)
/*
* While we are sending to collector, unlock cache.
* XXX: it can happen, however with a small probability,
* that item, we are holding now, can be moved to the top
* of flow cache by node thread. In this case our expire
* thread stops checking. Since this is not fatal we will
* just ignore it now.
* that item, we are holding now, can be moved to the
* top of flow cache by node thread. In this case our
* expire thread stops checking. Since this is not
* fatal we will just ignore it now.
*/
mtx_unlock(&priv->work_mtx);