Lines Matching refs:attr
29 static void ct_parse_u8(struct nf_conntrack *ct, int attr, void *data);
30 static void ct_parse_u16(struct nf_conntrack *ct, int attr, void *data);
31 static void ct_parse_u32(struct nf_conntrack *ct, int attr, void *data);
32 static void ct_parse_str(struct nf_conntrack *ct, int attr, void *data);
33 static void ct_parse_group(struct nf_conntrack *ct, int attr, void *data);
34 static void ct_parse_nat_seq_adj(struct nf_conntrack *ct, int attr, void *data);
37 void (*parse)(struct nf_conntrack *ct, int attr, void *data);
38 int attr;
46 .attr = ATTR_GRP_ORIG_IPV4,
51 .attr = ATTR_GRP_ORIG_IPV6,
56 .attr = ATTR_GRP_ORIG_PORT,
61 .attr = ATTR_L4PROTO,
66 .attr = ATTR_TCP_STATE,
71 .attr = ATTR_STATUS,
76 .attr = ATTR_MARK,
81 .attr = ATTR_TIMEOUT,
86 .attr = ATTR_GRP_MASTER_IPV4,
91 .attr = ATTR_GRP_MASTER_IPV6,
96 .attr = ATTR_MASTER_L4PROTO,
101 .attr = ATTR_GRP_MASTER_PORT,
106 .attr = ATTR_SNAT_IPV4,
111 .attr = ATTR_DNAT_IPV4,
116 .attr = ATTR_SNAT_PORT,
121 .attr = ATTR_DNAT_PORT,
130 .attr = ATTR_SCTP_STATE,
135 .attr = ATTR_SCTP_VTAG_ORIG,
140 .attr = ATTR_SCTP_VTAG_REPL,
145 .attr = ATTR_DCCP_STATE,
150 .attr = ATTR_DCCP_ROLE,
155 .attr = ATTR_ICMP_TYPE,
160 .attr = ATTR_ICMP_CODE,
165 .attr = ATTR_ICMP_ID,
170 .attr = ATTR_TCP_WSCALE_ORIG,
175 .attr = ATTR_TCP_WSCALE_REPL,
180 .attr = ATTR_HELPER_NAME,
186 ct_parse_u8(struct nf_conntrack *ct, int attr, void *data)
189 nfct_set_attr_u8(ct, h[attr].attr, *value);
193 ct_parse_u16(struct nf_conntrack *ct, int attr, void *data)
196 nfct_set_attr_u16(ct, h[attr].attr, ntohs(*value));
200 ct_parse_u32(struct nf_conntrack *ct, int attr, void *data)
203 nfct_set_attr_u32(ct, h[attr].attr, ntohl(*value));
207 ct_parse_str(struct nf_conntrack *ct, int attr, void *data)
209 nfct_set_attr(ct, h[attr].attr, data);
213 ct_parse_group(struct nf_conntrack *ct, int attr, void *data)
215 nfct_set_attr_grp(ct, h[attr].attr, data);
219 ct_parse_nat_seq_adj(struct nf_conntrack *ct, int attr, void *data)
239 struct netattr *attr;
245 attr = NETHDR_DATA(net);
248 ATTR_NETWORK2HOST(attr);
249 if (attr->nta_len > len)
251 if (attr->nta_attr > NTA_MAX)
253 if (h[attr->nta_attr].size &&
254 attr->nta_len != h[attr->nta_attr].size)
256 if (h[attr->nta_attr].max_size &&
257 attr->nta_len > h[attr->nta_attr].max_size)
259 if (h[attr->nta_attr].parse == NULL) {
260 attr = NTA_NEXT(attr, len);
263 h[attr->nta_attr].parse(ct, attr->nta_attr, NTA_DATA(attr));
264 attr = NTA_NEXT(attr, len);
270 static void exp_parse_ct_group(void *ct, int attr, void *data);
271 static void exp_parse_ct_u8(void *ct, int attr, void *data);
272 static void exp_parse_u32(void *exp, int attr, void *data);
273 static void exp_parse_str(void *exp, int attr, void *data);
276 void (*parse)(void *obj, int attr, void *data);
404 static void exp_parse_ct_group(void *ct, int attr, void *data)
406 nfct_set_attr_grp(ct, exp_h[attr].ct_attr, data);
409 static void exp_parse_ct_u8(void *ct, int attr, void *data)
412 nfct_set_attr_u8(ct, exp_h[attr].ct_attr, *value);
415 static void exp_parse_u32(void *exp, int attr, void *data)
418 nfexp_set_attr_u32(exp, exp_h[attr].exp_attr, ntohl(*value));
421 static void exp_parse_str(void *exp, int attr, void *data)
423 nfexp_set_attr(exp, exp_h[attr].exp_attr, data);
429 struct netattr *attr;
436 attr = NETHDR_DATA(net);
455 ATTR_NETWORK2HOST(attr);
456 if (attr->nta_len > len)
458 if (attr->nta_attr > NTA_MAX)
460 if (exp_h[attr->nta_attr].size &&
461 attr->nta_len != exp_h[attr->nta_attr].size)
463 if (exp_h[attr->nta_attr].max_size &&
464 attr->nta_len > exp_h[attr->nta_attr].max_size)
466 if (exp_h[attr->nta_attr].parse == NULL) {
467 attr = NTA_NEXT(attr, len);
470 switch(exp_h[attr->nta_attr].exp_attr) {
472 exp_h[attr->nta_attr].parse(master, attr->nta_attr,
473 NTA_DATA(attr));
475 exp_h[attr->nta_attr].parse(expected, attr->nta_attr,
476 NTA_DATA(attr));
478 exp_h[attr->nta_attr].parse(mask, attr->nta_attr,
479 NTA_DATA(attr));
482 exp_h[attr->nta_attr].parse(nat, attr->nta_attr,
483 NTA_DATA(attr));
492 exp_h[attr->nta_attr].parse(exp, attr->nta_attr,
493 NTA_DATA(attr));
496 attr = NTA_NEXT(attr, len);