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

static int neightbl_filter ( struct nl_object *  obj,
struct nl_object *  filter 
) [static]

Definition at line 56 of file neightbl.c.

References rtnl_neightbl::nt_mask, rtnl_neightbl::nt_name, and rtnl_neightbl::nt_parms.

{
      struct rtnl_neightbl *o = (struct rtnl_neightbl *) obj;
      struct rtnl_neightbl *f = (struct rtnl_neightbl *) filter;
      struct rtnl_neightbl_parms *op = &o->nt_parms;
      struct rtnl_neightbl_parms *fp = &f->nt_parms;

#define REQ(F) (f->nt_mask & NEIGHTBL_ATTR_##F)
#define AVAIL(F) (o->nt_mask & NEIGHTBL_ATTR_##F)
#define _O(F, EXPR) (REQ(F) && (!AVAIL(F) || (EXPR)))
#define _C(F, N) (REQ(F) && (!AVAIL(F) || (o->N != f->N)))
      
      if (_C(FAMILY,          nt_family)                    ||
          _O(NAME,            strcmp(o->nt_name, f->nt_name))           ||
          _C(THRESH1,   nt_gc_thresh1)                ||
          _C(THRESH2,   nt_gc_thresh2)                ||
          _C(THRESH3,   nt_gc_thresh3)                      ||
          _C(GC_INTERVAL,     nt_gc_interval))
            return 0;
#undef REQ
#undef AVAIL
#undef _O
#undef _C

      if (!(f->nt_mask & NEIGHTBL_ATTR_PARMS) &&
          !(o->nt_mask & NEIGHTBL_ATTR_PARMS))
            return 1;

#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

      return 1;
}


Generated by  Doxygen 1.6.0   Back to index