~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to include/linux/netfilter/ipset/pfxlen.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _PFXLEN_H
 
2
#define _PFXLEN_H
 
3
 
 
4
#include <asm/byteorder.h>
 
5
#include <linux/netfilter.h> 
 
6
 
 
7
/* Prefixlen maps, by Jan Engelhardt  */
 
8
extern const union nf_inet_addr ip_set_netmask_map[];
 
9
extern const union nf_inet_addr ip_set_hostmask_map[];
 
10
 
 
11
static inline __be32
 
12
ip_set_netmask(u8 pfxlen)
 
13
{
 
14
        return ip_set_netmask_map[pfxlen].ip;
 
15
}
 
16
 
 
17
static inline const __be32 *
 
18
ip_set_netmask6(u8 pfxlen)
 
19
{
 
20
        return &ip_set_netmask_map[pfxlen].ip6[0];
 
21
}
 
22
 
 
23
static inline u32
 
24
ip_set_hostmask(u8 pfxlen)
 
25
{
 
26
        return (__force u32) ip_set_hostmask_map[pfxlen].ip;
 
27
}
 
28
 
 
29
static inline const __be32 *
 
30
ip_set_hostmask6(u8 pfxlen)
 
31
{
 
32
        return &ip_set_hostmask_map[pfxlen].ip6[0];
 
33
}
 
34
 
 
35
#endif /*_PFXLEN_H */