static int delip_kernel(struct ip_set *set, const struct sk_buff *skb, ip_set_ip_t *hash_ip, const u_int32_t *flags, unsigned char index) { ip_set_ip_t port; if (flags[index+1] == 0) return -EINVAL; port = get_port(skb, flags[index+1]); DP("flag: %s src: %u.%u.%u.%u dst: %u.%u.%u.%u", flags[index] & IPSET_SRC ? "SRC" : "DST", NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr)); DP("flag %s port %u", flags[index+1] & IPSET_SRC ? "SRC" : "DST", port); if (port == INVALID_PORT) return -EINVAL; return __delip(set, ntohl(flags[index] & IPSET_SRC ? skb->nh.iph->saddr : skb->nh.iph->daddr), port, hash_ip); }
static int delip_kernel(struct ip_set *set, const struct sk_buff *skb, u_int32_t flags, ip_set_ip_t *hash_ip) { return __delip(set, ntohl(flags & IPSET_SRC ? skb->nh.iph->saddr : skb->nh.iph->daddr), hash_ip); }
static int delip(struct ip_set *set, const void *data, size_t size, ip_set_ip_t *hash_ip) { const struct ip_set_req_ipporthash *req = data; if (size != sizeof(struct ip_set_req_ipporthash)) { ip_set_printk("data length wrong (want %zu, have %zu)", sizeof(struct ip_set_req_ipporthash), size); return -EINVAL; } return __delip(set, req->ip, req->port, hash_ip); }
static int delip(struct ip_set *set, const void *data, size_t size, ip_set_ip_t *hash_ip) { struct ip_set_req_macipmap *req = (struct ip_set_req_macipmap *) data; if (size != sizeof(struct ip_set_req_macipmap)) { ip_set_printk("data length wrong (want %zu, have %zu)", sizeof(struct ip_set_req_macipmap), size); return -EINVAL; } return __delip(set, req->ip, hash_ip); }
static int delip(struct ip_set *set, const void *data, size_t size, ip_set_ip_t *hash_ip) { const struct ip_set_req_nethash *req = data; if (size != sizeof(struct ip_set_req_nethash)) { ip_set_printk("data length wrong (want %zu, have %zu)", sizeof(struct ip_set_req_nethash), size); return -EINVAL; } /* TODO: no garbage collection in map->cidr */ return __delip(set->data, req->ip, req->cidr, hash_ip); }
static int delip_kernel(struct ip_set *set, const struct sk_buff *skb, ip_set_ip_t *hash_ip, const u_int32_t *flags, unsigned char index) { struct ip_set_nethash *map = set->data; int ret = -ERANGE; ip_set_ip_t ip = ntohl(flags[index] & IPSET_SRC ? ip_hdr(skb)->saddr : ip_hdr(skb)->daddr); if (map->cidr[0]) ret = __delip(map, ip, map->cidr[0], hash_ip); return ret; }