};
/* Compute htable_bits from the user input parameter hashsize */
-static inline u8
+static u8
htable_bits(u32 hashsize)
{
/* Assume that hashsize == 2^htable_bits */
/* Network cidr size book keeping when the hash stores different
* sized networks */
-static inline void
+static void
add_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask)
{
u8 i;
h->nets[i].cidr = cidr;
}
-static inline void
+static void
del_cidr(struct ip_set_hash *h, u8 cidr, u8 host_mask)
{
u8 i;
}
/* Calculate the actual memory size of the set data */
-static inline size_t
+static size_t
ahash_memsize(const struct ip_set_hash *h, size_t dsize, u8 host_mask)
{
u32 i;
/* Special test function which takes into account the different network
* sizes added to the set */
-static inline int
+static int
type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
{
struct ip_set_hash *h = set->data;
}
#ifdef IP_SET_HASH_WITH_NETS
-static inline int
+static int
type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
{
struct ip_set_hash *h = set->data;
add_timer(&h->gc);
}
-static inline void
+static void
type_pf_gc_init(struct ip_set *set)
{
struct ip_set_hash *h = set->data;
add_timer(&map->gc);
}
-static inline void
+static void
bitmap_ip_gc_init(struct ip_set *set)
{
struct bitmap_ip_timeout *map = set->data;
add_timer(&map->gc);
}
-static inline void
+static void
bitmap_ipmac_gc_init(struct ip_set *set)
{
struct bitmap_ipmac *map = set->data;
add_timer(&map->gc);
}
-static inline void
+static void
bitmap_port_gc_init(struct ip_set *set)
{
struct bitmap_port_timeout *map = set->data;
/* Register and deregister settype */
-static inline struct ip_set_type *
+static struct ip_set_type *
find_set_type(const char *name, u8 family, u8 revision)
{
struct ip_set_type *type;
.len = IPSET_MAXNAMELEN - 1 },
};
-static inline void
+static void
ip_set_destroy_set(ip_set_id_t index)
{
struct ip_set *set = ip_set_list[index];
/* Flush sets */
-static inline void
+static void
ip_set_flush_set(struct ip_set *set)
{
pr_debug("set: %s", set->name);
}
}
-static inline int
+static int
dump_init(struct netlink_callback *cb)
{
struct nlmsghdr *nlh = nlmsg_hdr(cb->skb);
dst->ip = src->ip;
}
-static inline void
-hash_ip4_data_swap(struct hash_ip4_elem *dst, struct hash_ip4_elem *src)
-{
- swap(dst->ip, src->ip);
-}
-
/* Zero valued IP addresses cannot be stored */
static inline void
hash_ip4_data_zero_out(struct hash_ip4_elem *elem)
return 1;
}
-static inline bool
+static bool
hash_ip4_data_tlist(struct sk_buff *skb, const struct hash_ip4_elem *data)
{
const struct hash_ip4_telem *tdata =
ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
}
-static inline void
-hash_ip6_data_swap(struct hash_ip6_elem *dst, struct hash_ip6_elem *src)
-{
- struct in6_addr tmp;
-
- ipv6_addr_copy(&tmp, &dst->ip.in6);
- ipv6_addr_copy(&dst->ip.in6, &src->ip.in6);
- ipv6_addr_copy(&src->ip.in6, &tmp);
-}
-
static inline void
hash_ip6_data_zero_out(struct hash_ip6_elem *elem)
{
ip->ip6[3] &= ip_set_netmask6(prefix)[3];
}
-static inline bool
+static bool
hash_ip6_data_list(struct sk_buff *skb, const struct hash_ip6_elem *data)
{
NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
return 1;
}
-static inline bool
+static bool
hash_ip6_data_tlist(struct sk_buff *skb, const struct hash_ip6_elem *data)
{
const struct hash_ip6_telem *e =
dst->proto = src->proto;
}
-static inline void
-hash_ipport4_data_swap(struct hash_ipport4_elem *dst,
- struct hash_ipport4_elem *src)
-{
- swap(dst->ip, src->ip);
- swap(dst->port, src->port);
- swap(dst->proto, src->proto);
-}
-
static inline void
hash_ipport4_data_zero_out(struct hash_ipport4_elem *elem)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_ipport4_data_list(struct sk_buff *skb,
const struct hash_ipport4_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipport4_data_tlist(struct sk_buff *skb,
const struct hash_ipport4_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_ipport6_data_swap(struct hash_ipport6_elem *dst,
- struct hash_ipport6_elem *src)
-{
- struct hash_ipport6_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_ipport6_data_zero_out(struct hash_ipport6_elem *elem)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_ipport6_data_list(struct sk_buff *skb,
const struct hash_ipport6_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipport6_data_tlist(struct sk_buff *skb,
const struct hash_ipport6_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_ipportip4_data_swap(struct hash_ipportip4_elem *dst,
- struct hash_ipportip4_elem *src)
-{
- struct hash_ipportip4_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_ipportip4_data_zero_out(struct hash_ipportip4_elem *elem)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_ipportip4_data_list(struct sk_buff *skb,
const struct hash_ipportip4_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipportip4_data_tlist(struct sk_buff *skb,
const struct hash_ipportip4_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_ipportip6_data_swap(struct hash_ipportip6_elem *dst,
- struct hash_ipportip6_elem *src)
-{
- struct hash_ipportip6_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_ipportip6_data_zero_out(struct hash_ipportip6_elem *elem)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_ipportip6_data_list(struct sk_buff *skb,
const struct hash_ipportip6_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipportip6_data_tlist(struct sk_buff *skb,
const struct hash_ipportip6_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_ipportnet4_data_swap(struct hash_ipportnet4_elem *dst,
- struct hash_ipportnet4_elem *src)
-{
- struct hash_ipportnet4_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_ipportnet4_data_netmask(struct hash_ipportnet4_elem *elem, u8 cidr)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_ipportnet4_data_list(struct sk_buff *skb,
const struct hash_ipportnet4_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipportnet4_data_tlist(struct sk_buff *skb,
const struct hash_ipportnet4_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_ipportnet6_data_swap(struct hash_ipportnet6_elem *dst,
- struct hash_ipportnet6_elem *src)
-{
- struct hash_ipportnet6_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_ipportnet6_data_zero_out(struct hash_ipportnet6_elem *elem)
{
elem->cidr = cidr;
}
-static inline bool
+static bool
hash_ipportnet6_data_list(struct sk_buff *skb,
const struct hash_ipportnet6_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_ipportnet6_data_tlist(struct sk_buff *skb,
const struct hash_ipportnet6_elem *data)
{
dst->cidr = src->cidr;
}
-static inline void
-hash_net4_data_swap(struct hash_net4_elem *dst,
- struct hash_net4_elem *src)
-{
- swap(dst->ip, src->ip);
- swap(dst->cidr, src->cidr);
-}
-
static inline void
hash_net4_data_netmask(struct hash_net4_elem *elem, u8 cidr)
{
elem->cidr = 0;
}
-static inline bool
+static bool
hash_net4_data_list(struct sk_buff *skb, const struct hash_net4_elem *data)
{
NLA_PUT_IPADDR4(skb, IPSET_ATTR_IP, data->ip);
return 1;
}
-static inline bool
+static bool
hash_net4_data_tlist(struct sk_buff *skb, const struct hash_net4_elem *data)
{
const struct hash_net4_telem *tdata =
dst->cidr = src->cidr;
}
-static inline void
-hash_net6_data_swap(struct hash_net6_elem *dst, struct hash_net6_elem *src)
-{
- struct hash_net6_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_net6_data_zero_out(struct hash_net6_elem *elem)
{
elem->cidr = cidr;
}
-static inline bool
+static bool
hash_net6_data_list(struct sk_buff *skb, const struct hash_net6_elem *data)
{
NLA_PUT_IPADDR6(skb, IPSET_ATTR_IP, &data->ip);
return 1;
}
-static inline bool
+static bool
hash_net6_data_tlist(struct sk_buff *skb, const struct hash_net6_elem *data)
{
const struct hash_net6_telem *e =
dst->cidr = src->cidr;
}
-static inline void
-hash_netport4_data_swap(struct hash_netport4_elem *dst,
- struct hash_netport4_elem *src)
-{
- swap(dst->ip, src->ip);
- swap(dst->port, src->port);
- swap(dst->proto, src->proto);
- swap(dst->cidr, src->cidr);
-}
-
static inline void
hash_netport4_data_netmask(struct hash_netport4_elem *elem, u8 cidr)
{
elem->proto = 0;
}
-static inline bool
+static bool
hash_netport4_data_list(struct sk_buff *skb,
const struct hash_netport4_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_netport4_data_tlist(struct sk_buff *skb,
const struct hash_netport4_elem *data)
{
memcpy(dst, src, sizeof(*dst));
}
-static inline void
-hash_netport6_data_swap(struct hash_netport6_elem *dst,
- struct hash_netport6_elem *src)
-{
- struct hash_netport6_elem tmp;
-
- memcpy(&tmp, dst, sizeof(tmp));
- memcpy(dst, src, sizeof(tmp));
- memcpy(src, &tmp, sizeof(tmp));
-}
-
static inline void
hash_netport6_data_zero_out(struct hash_netport6_elem *elem)
{
elem->cidr = cidr;
}
-static inline bool
+static bool
hash_netport6_data_list(struct sk_buff *skb,
const struct hash_netport6_elem *data)
{
return 1;
}
-static inline bool
+static bool
hash_netport6_data_tlist(struct sk_buff *skb,
const struct hash_netport6_elem *data)
{
[IPSET_ATTR_CADT_FLAGS] = { .type = NLA_U32 },
};
-static inline bool
+static bool
next_id_eq(const struct list_set *map, u32 i, ip_set_id_t id)
{
const struct set_elem *elem;
return 0;
}
-static inline void
+static void
list_elem_add(struct list_set *map, u32 i, ip_set_id_t id)
{
struct set_elem *e;
}
}
-static inline void
+static void
list_elem_tadd(struct list_set *map, u32 i, ip_set_id_t id,
unsigned long timeout)
{
add_timer(&map->gc);
}
-static inline void
+static void
list_set_gc_init(struct ip_set *set)
{
struct list_set *map = set->data;
[IPSET_ATTR_TIMEOUT] = { .type = NLA_U32 },
};
-static inline bool
+static bool
init_list_set(struct ip_set *set, u32 size, size_t dsize,
unsigned long timeout)
{