tools/udpTools/udpClientEtherInfo.c
/* Find the hash node that corresponds the ether address 'ep' */
Find the hash node that corresponds the ether address 'ep'
Find the hash node that corresponds the ether address ' ep '
static inline struct enamemem *lookupEmem(netdissect_options *ndo, const u_char *ep) {
  register u_int i, j, k;
  struct enamemem *tp;
  k = (ep[0] << 8) | ep[1];
  j = (ep[2] << 8) | ep[3];
  i = (ep[4] << 8) | ep[5];
  tp = &enametable[(i ^ j) & (HASHNAMESIZE-1)];
  while (tp->e_nxt)
    if (tp->e_addr0 == i &&
        tp->e_addr1 == j &&
        tp->e_addr2 == k)
      return tp;
    else
      tp = tp->e_nxt;
  tp->e_addr0 = i;
  tp->e_addr1 = j;
  tp->e_addr2 = k;
  tp->e_nxt = (struct enamemem *)calloc(1, sizeof(*tp));
  if (tp->e_nxt == NULL)
    (*ndo->ndo_error)(ndo, "lookupEmem: calloc");
  return tp;
}
static inline struct enamemem * lookupEmem ( netdissect_options * ndo , const u_char * ep ) { register u_int i , j , k ; struct enamemem * tp ; k = ( ep [ 0 ] << 8 ) | ep [ 1 ] ; j = ( ep [ 2 ] << 8 ) | ep [ 3 ] ; i = ( ep [ 4 ] << 8 ) | ep [ 5 ] ; tp = & enametable [ ( i ^ j ) & ( HASHNAMESIZE - 1 ) ] ; while ( tp -> e_nxt ) if ( tp -> e_addr0 == i && tp -> e_addr1 == j && tp -> e_addr2 == k ) return tp ; else tp = tp -> e_nxt ; tp -> e_addr0 = i ; tp -> e_addr1 = j ; tp -> e_addr2 = k ; tp -> e_nxt = ( struct enamemem * ) calloc ( 1 , sizeof ( * tp ) ) ; if ( tp -> e_nxt == NULL ) ( * ndo -> ndo_error ) ( ndo , " " ) ; return tp ; }
Find the hash node that corresponds the ether address 'ep'
Find the hash node that corresponds the ether address ' ep '