src/sflow_api.c
SFLSampler *sfl_agent_getSamplerByIfIndex(SFLAgent *agent, uint32_t ifIndex)
{
    SFLSampler *search = agent->jumpTable[ifIndex % SFL_HASHTABLE_SIZ];
    for( ; search != NULL; search = search->hash_nxt) if(SFL_DS_INDEX(search->dsi) == ifIndex) break;
    return search;
}
/*_________________--------------------------------__________________
  _________________  sfl_agent_getSamplerByIfIndex __________________
  -----------------________________________________------------------
  fast lookup (pointers cached in hash table).  If there are multiple
  sampler instances for a given ifIndex, then this fn will return
  the one with the lowest instance number.  Since the samplers
  list is sorted, this means the other instances will be accesible
  by following the sampler->nxt pointer (until the ds_class
  or ds_index changes).  This is helpful if you need to offer
  the same flowSample to multiple samplers.
*/
fast lookup (pointers cached in hash table).  If there are multiple
sampler instances for a given ifIndex, then this fn will return
the one with the lowest instance number.  Since the samplers
list is sorted, this means the other instances will be accesible
by following the sampler->nxt pointer (until the ds_class
or ds_index changes).  This is helpful if you need to offer
the same flowSample to multiple samplers.
fast lookup ( pointers cached in hash table ) . If there are multiple sampler instances for a given ifIndex then this fn will return the one with the lowest instance number . Since the samplers list is sorted this means the other instances will be accesible by following the sampler - > nxt pointer ( until the ds_class or ds_index changes ) . This is helpful if you need to offer the same flowSample to multiple samplers .
SFLSampler *sfl_agent_getSamplerByIfIndex(SFLAgent *agent, uint32_t ifIndex)
{
    SFLSampler *search = agent->jumpTable[ifIndex % SFL_HASHTABLE_SIZ];
    for( ; search != NULL; search = search->hash_nxt) if(SFL_DS_INDEX(search->dsi) == ifIndex) break;
    return search;
}
SFLSampler * sfl_agent_getSamplerByIfIndex ( SFLAgent * agent , uint32_t ifIndex ) { SFLSampler * search = agent -> jumpTable [ ifIndex % SFL_HASHTABLE_SIZ ] ; for ( ; search != NULL ; search = search -> hash_nxt ) if ( SFL_DS_INDEX ( search -> dsi ) == ifIndex ) break ; return search ; }
_________________--------------------------------__________________
_________________  sfl_agent_getSamplerByIfIndex __________________
________________________________
fast lookup (pointers cached in hash table).
_________________ -------------------------------- __________________ _________________ sfl_agent_getSamplerByIfIndex __________________ ________________________________ fast lookup ( pointers cached in hash table ) .