mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-21 20:14:56 +02:00
ipset: rename ipset-5 directory to ipset-6
This commit is contained in:
35
extensions/ipset-6/pfxlen.h
Normal file
35
extensions/ipset-6/pfxlen.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef _PFXLEN_H
|
||||
#define _PFXLEN_H
|
||||
|
||||
#include <asm/byteorder.h>
|
||||
#include <linux/netfilter.h>
|
||||
|
||||
/* Prefixlen maps, by Jan Engelhardt */
|
||||
extern const union nf_inet_addr ip_set_netmask_map[];
|
||||
extern const union nf_inet_addr ip_set_hostmask_map[];
|
||||
|
||||
static inline __be32
|
||||
ip_set_netmask(u8 pfxlen)
|
||||
{
|
||||
return ip_set_netmask_map[pfxlen].ip;
|
||||
}
|
||||
|
||||
static inline const __be32 *
|
||||
ip_set_netmask6(u8 pfxlen)
|
||||
{
|
||||
return &ip_set_netmask_map[pfxlen].ip6[0];
|
||||
}
|
||||
|
||||
static inline u32
|
||||
ip_set_hostmask(u8 pfxlen)
|
||||
{
|
||||
return (__force u32) ip_set_hostmask_map[pfxlen].ip;
|
||||
}
|
||||
|
||||
static inline const __be32 *
|
||||
ip_set_hostmask6(u8 pfxlen)
|
||||
{
|
||||
return &ip_set_hostmask_map[pfxlen].ip6[0];
|
||||
}
|
||||
|
||||
#endif /*_PFXLEN_H */
|
Reference in New Issue
Block a user