xfrm_address_t
xfrm_addr_any(const xfrm_address_t *addr, unsigned short family)
xfrm_address_t *xfrm_flowi_daddr(const struct flowi *fl, unsigned short family)
return (xfrm_address_t *)&fl->u.ip4.daddr;
return (xfrm_address_t *)&fl->u.ip6.daddr;
xfrm_address_t *xfrm_flowi_saddr(const struct flowi *fl, unsigned short family)
return (xfrm_address_t *)&fl->u.ip4.saddr;
return (xfrm_address_t *)&fl->u.ip6.saddr;
xfrm_address_t *saddr, xfrm_address_t *daddr,
const xfrm_address_t *daddr, const xfrm_address_t *saddr)
const xfrm_address_t *daddr, const xfrm_address_t *saddr)
const xfrm_address_t *daddr, const xfrm_address_t *saddr,
(const xfrm_address_t *)&fl->u.ip4.daddr,
(const xfrm_address_t *)&fl->u.ip4.saddr);
(const xfrm_address_t *)&fl->u.ip6.daddr,
(const xfrm_address_t *)&fl->u.ip6.saddr);
struct xfrm_state *xfrm_state_find(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
xfrm_address_t *daddr,
xfrm_address_t *saddr,
const xfrm_address_t *daddr, __be32 spi,
const xfrm_address_t *daddr,
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
xfrm_address_t *saddr, u8 proto);
__be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr);
__be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr);
const xfrm_address_t *daddr,
const xfrm_address_t *saddr, int create,
int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
xfrm_address_t *addr);
static inline bool xfrm6_addr_equal(const xfrm_address_t *a,
const xfrm_address_t *b)
static inline bool xfrm_addr_equal(const xfrm_address_t *a,
const xfrm_address_t *b,
xfrm_address_t saddr;
xfrm_address_t *coaddr;
xfrm_address_t *saddr;
xfrm_address_t *daddr;
int (*get_saddr)(xfrm_address_t *saddr,
xfrm_address_t saddr;
xfrm_address_t local;
xfrm_address_t remote;
xfrm_address_t old_daddr;
xfrm_address_t old_saddr;
xfrm_address_t new_daddr;
xfrm_address_t new_saddr;
int (*new_mapping)(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport);
int (*report)(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr);
xfrm_address_t saddr;
xfrm_address_t encap_oa;
xfrm_address_t daddr;
xfrm_address_t saddr;
xfrm_address_t daddr;
xfrm_address_t saddr;
xfrm_address_t saddr;
xfrm_address_t local;
xfrm_address_t remote;
xfrm_address_t old_daddr;
xfrm_address_t old_saddr;
xfrm_address_t new_daddr;
xfrm_address_t new_saddr;
xfrm_address_t daddr;
xfrm_address_t old_saddr;
xfrm_address_t new_saddr;
xfrm_address_t saddr;
xfrm_address_t saddr;
xfrm_address_t daddr;
(xfrm_address_t *)&pkt_dev->cur_daddr,
(xfrm_address_t *)&pkt_dev->cur_saddr,
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
xfrm_address_t ipaddr;
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
(xfrm_address_t *)&ip_hdr(skb)->daddr,
xfrm_address_t *daddr = (xfrm_address_t *)&dst;
xfrm_address_t *saddr = (xfrm_address_t *)&src;
x = xfrm_state_lookup(net, mark, (const xfrm_address_t *)&iph->daddr,
t = xfrm_state_lookup(net, mark, (xfrm_address_t *)&x->id.daddr.a4,
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
static int xfrm4_get_saddr(xfrm_address_t *saddr,
x = xfrm_state_lookup(net, skb->mark, (xfrm_address_t *)&iph->daddr, ah->spi, IPPROTO_AH, AF_INET6);
xfrm_address_t ipaddr;
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
(xfrm_address_t *)&ipv6_hdr(skb)->daddr,
ret = xfrm6_input_addr(skb, (xfrm_address_t *)&ipv6h->daddr,
(xfrm_address_t *)&hao->addr, IPPROTO_DSTOPTS);
if (xfrm6_input_addr(skb, (xfrm_address_t *)addr,
(xfrm_address_t *)&ipv6_hdr(skb)->saddr,
const xfrm_address_t *saddr;
saddr = (const xfrm_address_t *)&ipv6_hdr(skb)->saddr;
xfrm_address_t *daddr = (xfrm_address_t *)dst;
xfrm_address_t *saddr = (xfrm_address_t *)src;
x = xfrm_state_lookup(net, mark, (const xfrm_address_t *)&iph->daddr,
spi = xfrm6_tunnel_spi_lookup(net, (xfrm_address_t *)&x->props.saddr);
t = xfrm_state_lookup(net, mark, (xfrm_address_t *)&x->id.daddr,
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
t->id.spi = xfrm6_tunnel_alloc_spi(net, (xfrm_address_t *)&x->props.saddr);
memcpy(&sel.daddr, (xfrm_address_t *)&ipv6_hdr(skb)->daddr,
memcpy(&sel.saddr, (xfrm_address_t *)&ipv6_hdr(skb)->saddr,
(hao ? (xfrm_address_t *)&hao->addr : NULL));
int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr,
xfrm_address_t *saddr, u8 proto)
xfrm_address_t *dst, *src;
src = (xfrm_address_t *)&in6addr_any;
dst = (xfrm_address_t *)&in6addr_any;
src = (xfrm_address_t *)&in6addr_any;
static int xfrm6_get_saddr(xfrm_address_t *saddr,
static u32 __xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr)
__be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr)
static void xfrm6_tunnel_free_spi(struct net *net, xfrm_address_t *saddr)
spi = xfrm6_tunnel_spi_lookup(net, (const xfrm_address_t *)&iph->saddr);
xfrm6_tunnel_free_spi(net, (xfrm_address_t *)&x->props.saddr);
xfrm_address_t addr;
static inline unsigned int xfrm6_tunnel_spi_hash_byaddr(const xfrm_address_t *addr)
static struct xfrm6_tunnel_spi *__xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr)
__be32 xfrm6_tunnel_spi_lookup(struct net *net, const xfrm_address_t *saddr)
xfrm_address_t *xsaddr = NULL, *xdaddr = NULL;
xdaddr = (xfrm_address_t *)&((struct sockaddr_in *)(daddr + 1))->sin_addr.s_addr;
xsaddr = (xfrm_address_t *)&((struct sockaddr_in *)(saddr + 1))->sin_addr.s_addr;
xdaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(daddr + 1))->sin6_addr;
xsaddr = (xfrm_address_t *)&((struct sockaddr_in6 *)(saddr + 1))->sin6_addr;
(sizeof(xfrm_address_t) << 3)) ||
(sizeof(xfrm_address_t) << 3))) {
sizeof(xfrm_address_t));
sizeof(xfrm_address_t));
xfrm_address_t *saddr, xfrm_address_t *daddr,
static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport)
const xfrm_address_t *src, const xfrm_address_t *dst)
int pfkey_sockaddr_extract(const struct sockaddr *sa, xfrm_address_t *xaddr)
int pfkey_sadb_addr2xfrm_addr(const struct sadb_address *addr, xfrm_address_t *xaddr)
xfrm_address_t *xaddr;
xfrm_address_t *saddr, xfrm_address_t *daddr,
xaddr = (xfrm_address_t *)&((const struct sockaddr_in *)(addr + 1))->sin_addr;
xaddr = (xfrm_address_t *)&((const struct sockaddr_in6 *)(addr + 1))->sin6_addr;
static unsigned int pfkey_sockaddr_fill(const xfrm_address_t *xaddr, __be16 port,
[XFRMA_SRCADDR] = { .len = sizeof(xfrm_address_t) },
[XFRMA_COADDR] = { .len = sizeof(xfrm_address_t) },
xfrm_address_t saddr;
xfrm_address_t saddr;
xfrm_address_t *saddr;
xfrm_address_t *daddr;
static inline unsigned int __xfrm_src_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
__xfrm_spi_hash(const xfrm_address_t *daddr, __be32 spi, u8 proto,
static inline unsigned int __xfrm6_addr_hash(const xfrm_address_t *addr)
const xfrm_address_t *daddr = &sel->daddr;
const xfrm_address_t *saddr = &sel->saddr;
static inline unsigned int __addr_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
static inline unsigned int __xfrm4_daddr_saddr_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr)
static inline unsigned int __xfrm6_daddr_saddr_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr)
static inline unsigned int __xfrm4_dpref_spref_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
static inline unsigned int __xfrm6_pref_hash(const xfrm_address_t *addr,
static inline unsigned int __xfrm6_dpref_spref_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
static inline unsigned int __xfrm_dst_hash(const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
static inline unsigned int __xfrm4_addr_hash(const xfrm_address_t *addr)
xfrm_address_t *daddr;
daddr = (xfrm_address_t *)(skb_network_header(skb) +
const xfrm_address_t *saddr;
saddr = (const xfrm_address_t *)&ipv6_hdr(skb)->saddr;
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
x = xfrm_state_lookup(net, skb->mark, (const xfrm_address_t *)&iph->daddr,
xfrm_address_t saddr;
xfrm_address_t daddr;
xfrm_address_t *addr,
const xfrm_address_t *addr, u16 family)
const xfrm_address_t *saddr,
const xfrm_address_t *daddr)
const xfrm_address_t *saddr,
const xfrm_address_t *daddr);
const xfrm_address_t *daddr, *saddr;
xfrm_get_saddr(unsigned short family, xfrm_address_t *saddr,
xfrm_address_t *daddr = xfrm_flowi_daddr(fl, family);
xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family);
xfrm_address_t tmp;
xfrm_address_t *remote = daddr;
xfrm_address_t *local = saddr;
xfrm_address_t saddr, daddr;
xfrm_address_t *prev_saddr,
xfrm_address_t *prev_daddr,
xfrm_address_t *saddr = &x->props.saddr;
xfrm_address_t *daddr = &x->id.daddr;
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
xfrm_address_t addr;
static bool xfrm_pol_inexact_addr_use_any_list(const xfrm_address_t *addr,
const xfrm_address_t *addr;
const xfrm_address_t *addr, u8 prefixlen)
xfrm_pol_inexact_node_alloc(const xfrm_address_t *addr, u8 prefixlen)
static int xfrm_policy_addr_delta(const xfrm_address_t *a,
const xfrm_address_t *b,
const xfrm_address_t *daddr, const xfrm_address_t *saddr,
const xfrm_address_t *daddr,
const xfrm_address_t *daddr,
const xfrm_address_t *daddr,
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
xfrm_state_find(const xfrm_address_t *daddr, const xfrm_address_t *saddr,
static xfrm_address_t saddr_wildcard = { };
xfrm_address_t *daddr, xfrm_address_t *saddr,
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32 spi,
const xfrm_address_t *daddr, const xfrm_address_t *saddr,
u32 if_id, u32 pcpu_num, u8 proto, const xfrm_address_t *daddr,
const xfrm_address_t *saddr, int create, unsigned short family)
static int __km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport)
int km_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr, __be16 sport)
int km_report(struct net *net, u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
const xfrm_address_t *daddr,
const xfrm_address_t *saddr,
xfrm_spi_hash(struct net *net, const xfrm_address_t *daddr,
xfrm_address_t daddr;
xfrm_address_t *saddr = NULL;
xfrm_address_t **addrp)
if (filter->splen > (sizeof(xfrm_address_t) << 3) ||
filter->dplen > (sizeof(xfrm_address_t) << 3)) {
xfrm_address_t *daddr;
sizeof(xfrm_address_t));
[XFRMA_SRCADDR] = { .len = sizeof(xfrm_address_t) },
[XFRMA_COADDR] = { .len = sizeof(xfrm_address_t) },
struct xfrm_selector *sel, xfrm_address_t *addr)
struct xfrm_selector *sel, xfrm_address_t *addr)
xfrm_address_t *new_saddr, __be16 new_sport)
static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
xfrm_address_t saddr = {};