l = c[0];
l |= c[1]<<8;
l |= c[2]<<16;
l |= c[3]<<24;
l |= (uvlong)c[4]<<32;
l |= (uvlong)c[5]<<40;
return l;
}
static int
p_filter(Filter *f, Msg *m)
{
Hdr *h;
if(m->pe - m->ps < Hsize)
return 0;
h = (Hdr*)m->ps;
m->ps += Hsize;
switch(f->subop){
case Oaflag:
return h->aflag == f->ulv;
case Ocmd:
return h->cmd == f->ulv;
case Ofeat:
return h->feat == f->ulv;
case Osectors:
return h->sectors == f->ulv;
case Olba:
return llba(h->lba) == f->vlv;
/* this is wrong, but we don't have access to the direction here */
case Ostat:
return h->cmd == f->ulv;
case Oerr:
return h->feat == f->ulv;
}
return 0;
}