Logo Search packages:      
Sourcecode: libnl2 version File versions  Download package

static int neightbl_compare ( struct nl_object *  _a,
struct nl_object *  _b,
uint32_t  attrs,
int  flags 
) [static]

Definition at line 57 of file neightbl.c.

References rtnl_neightbl::nt_family, rtnl_neightbl::nt_gc_interval, rtnl_neightbl::nt_gc_thresh1, rtnl_neightbl::nt_gc_thresh2, rtnl_neightbl::nt_gc_thresh3, and rtnl_neightbl::nt_name.

{
      struct rtnl_neightbl *a = (struct rtnl_neightbl *) _a;
      struct rtnl_neightbl *b = (struct rtnl_neightbl *) _b;
      int diff = 0;

#define NT_DIFF(ATTR, EXPR) ATTR_DIFF(attrs, NEIGHTBL_ATTR_##ATTR, a, b, EXPR)

      diff |= NT_DIFF(FAMILY,       a->nt_family != b->nt_family);
      diff |= NT_DIFF(NAME,         strcmp(a->nt_name, b->nt_name));
      diff |= NT_DIFF(THRESH1,      a->nt_gc_thresh1 != b->nt_gc_thresh1);
      diff |= NT_DIFF(THRESH2,      a->nt_gc_thresh2 != b->nt_gc_thresh2);
      diff |= NT_DIFF(THRESH3,      a->nt_gc_thresh3 != b->nt_gc_thresh3);
      diff |= NT_DIFF(GC_INTERVAL,  a->nt_gc_interval != b->nt_gc_interval);

#undef NT_DIFF

      if (!(a->ce_mask & NEIGHTBL_ATTR_PARMS) &&
          !(b->ce_mask & NEIGHTBL_ATTR_PARMS))
            return diff;

      /* XXX: FIXME: Compare parameter table */


#if 0
#define REQ(F) (fp->ntp_mask & NEIGHTBLPARM_ATTR_##F)
#define AVAIL(F) (op->ntp_mask & NEIGHTBLPARM_ATTR_##F)
#define _C(F, N) (REQ(F) && (!AVAIL(F) || (op->N != fp->N)))
      if (_C(IFINDEX,               ntp_ifindex)                  ||
          _C(QUEUE_LEN,       ntp_queue_len)                ||
          _C(APP_PROBES,            ntp_app_probes)               ||
          _C(UCAST_PROBES,          ntp_ucast_probes)       ||
          _C(MCAST_PROBES,          ntp_mcast_probes)       ||
          _C(PROXY_QLEN,            ntp_proxy_qlen)               ||
          _C(LOCKTIME,        ntp_locktime)                 ||
          _C(RETRANS_TIME,          ntp_retrans_time)       ||
          _C(BASE_REACHABLE_TIME,   ntp_base_reachable_time)      ||
          _C(GC_STALETIME,          ntp_gc_stale_time)            ||
          _C(DELAY_PROBE_TIME,      ntp_probe_delay)        ||
          _C(ANYCAST_DELAY,         ntp_anycast_delay)            ||
          _C(PROXY_DELAY,           ntp_proxy_delay))
            return 0;
#undef REQ
#undef AVAIL
#undef _C
#endif

      return diff;
}


Generated by  Doxygen 1.6.0   Back to index