Lines Matching defs:cmp
32 "Usage: cmp(ALIGN at OFFSET [ ATTRS ] { eq | lt | gt } VALUE)\n" \
37 "Example: cmp(u16 at 3 layer 2 mask 0xff00 gt 20)\n",
48 struct tcf_em_cmp cmp;
50 memset(&cmp, 0, sizeof(cmp));
56 return PARSE_ERR(args, "cmp: missing arguments");
65 return PARSE_ERR(args, "cmp: invalid alignment");
70 return PARSE_ERR(a, "cmp: missing argument");
75 return PARSE_ERR(a, "cmp: invalid offset, " \
81 return PARSE_ERR(a, "cmp: missing argument");
88 return PARSE_ERR(a, "cmp: invalid " \
93 return PARSE_ERR(a, "cmp: illegal layer, " \
97 return PARSE_ERR(a, "cmp: missing argument");
102 return PARSE_ERR(a, "cmp: invalid mask");
104 cmp.flags |= TCF_EM_CMP_TRANS;
116 return PARSE_ERR(a, "cmp: missing argument");
121 return PARSE_ERR(a, "cmp: invalid value");
129 return PARSE_ERR(a, "cmp: offset and value required");
131 cmp.val = (__u32) value;
132 cmp.mask = (__u32) mask;
133 cmp.off = (__u16) offset;
134 cmp.align = (__u8) align;
135 cmp.layer = (__u8) layer;
136 cmp.opnd = (__u8) opnd;
139 addraw_l(n, MAX_MSG, &cmp, sizeof(cmp));
148 struct tcf_em_cmp *cmp = data;
150 if (data_len < sizeof(*cmp)) {
155 if (cmp->align == TCF_EM_ALIGN_U8)
157 else if (cmp->align == TCF_EM_ALIGN_U16)
159 else if (cmp->align == TCF_EM_ALIGN_U16)
162 fprintf(fd, "at %d layer %d ", cmp->off, cmp->layer);
164 if (cmp->mask)
165 fprintf(fd, "mask 0x%x ", cmp->mask);
167 if (cmp->flags & TCF_EM_CMP_TRANS)
170 if (cmp->opnd == TCF_EM_OPND_EQ)
172 else if (cmp->opnd == TCF_EM_OPND_LT)
174 else if (cmp->opnd == TCF_EM_OPND_GT)
177 fprintf(fd, "%d", cmp->val);
183 .kind = "cmp",