20 static Field p_fields[] = {
21 {"cmd", Fnum, Ocmd, "command", },
22 {"nea", Fnum, Onea, "ea count", },
23 {"ea", Fnum, Onea, "ethernet addr", },
31 compile_cmp(aoerr.name, f, p_fields);
34 sysfatal("unknown aoerr field: %s", f->s);
38 p_filter(Filter *f, Msg *m)
44 if(m->pe - m->ps < Hsize)
52 return h->cmd == f->ulv;
54 return h->nea == f->ulv;
56 if(m->pe - m->ps < 6*h->nea)
58 for(i = 0; i < 6; i++)
59 buf[i] = f->ulv >> ((5 - i)*8);
60 for(i = 0; i < h->nea; i++)
61 if(memcmp(m->ps + 6*i, buf, 6) == 0)
68 static char *ctab[] = {
81 if(m->pe - m->ps < Hsize)
87 /* no next protocol */
91 if(h->cmd < nelem(ctab))
93 m->p = seprint(m->p, m->e, "cmd=%d %s nea=%d", h->cmd, s, h->nea);
98 m->p = seprint(m->p, m->e, " ...");
101 if(m->pe - m->ps < 6*i){
102 m->p = seprint(m->p, m->e, " *short*");
105 m->p = seprint(m->p, m->e, " %E", m->pe + 6*i);
107 m->p = seprint(m->p, m->e, "\n");