Lines Matching refs:tb

108 hash_ipportip4_uadt(struct ip_set *set, struct nlattr *tb[],
119 if (tb[IPSET_ATTR_LINENO])
120 *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
122 if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
123 !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
124 !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO)))
127 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP], &e.ip);
131 ret = ip_set_get_extensions(set, tb, &ext);
135 ret = ip_set_get_ipaddr4(tb[IPSET_ATTR_IP2], &e.ip2);
139 e.port = nla_get_be16(tb[IPSET_ATTR_PORT]);
141 if (tb[IPSET_ATTR_PROTO]) {
142 e.proto = nla_get_u8(tb[IPSET_ATTR_PROTO]);
155 !(tb[IPSET_ATTR_IP_TO] || tb[IPSET_ATTR_CIDR] ||
156 tb[IPSET_ATTR_PORT_TO])) {
162 if (tb[IPSET_ATTR_IP_TO]) {
163 ret = ip_set_get_hostipaddr4(tb[IPSET_ATTR_IP_TO], &ip_to);
168 } else if (tb[IPSET_ATTR_CIDR]) {
169 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
177 if (with_ports && tb[IPSET_ATTR_PORT_TO]) {
178 port_to = ip_set_get_h16(tb[IPSET_ATTR_PORT_TO]);
278 hash_ipportip6_uadt(struct ip_set *set, struct nlattr *tb[],
289 if (tb[IPSET_ATTR_LINENO])
290 *lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
292 if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
293 !ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
294 !ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO)))
296 if (unlikely(tb[IPSET_ATTR_IP_TO]))
298 if (unlikely(tb[IPSET_ATTR_CIDR])) {
299 u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
305 ret = ip_set_get_ipaddr6(tb[IPSET_ATTR_IP], &e.ip);
309 ret = ip_set_get_extensions(set, tb, &ext);
313 ret = ip_set_get_ipaddr6(tb[IPSET_ATTR_IP2], &e.ip2);
317 e.port = nla_get_be16(tb[IPSET_ATTR_PORT]);
319 if (tb[IPSET_ATTR_PROTO]) {
320 e.proto = nla_get_u8(tb[IPSET_ATTR_PROTO]);
332 if (adt == IPSET_TEST || !with_ports || !tb[IPSET_ATTR_PORT_TO]) {
338 port_to = ip_set_get_h16(tb[IPSET_ATTR_PORT_TO]);