pxremap.h revision a218a3f92594b5f2beb9c8298c6fe6e3a8e502f8
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunnington/* -*- indent-tabs-mode: nil; -*- */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#ifndef _pxremap_h_
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define _pxremap_h_
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#include "lwip/err.h"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#include "lwip/ip_addr.h"
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterstruct netif;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define PXREMAP_FAILED (-1)
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define PXREMAP_ASIS 0
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define PXREMAP_MAPPED 1
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* IPv4 */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#if ARP_PROXY
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_proxy_arp(struct netif *netif, ip_addr_t *dst);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#endif
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_ip4_divert(struct netif *netif, ip_addr_t *dst);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_outbound_ip4(ip_addr_t *dst, ip_addr_t *src);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_inbound_ip4(ip_addr_t *dst, ip_addr_t *src);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster/* IPv6 */
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_proxy_na(struct netif *netif, ip6_addr_t *dst);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Fosterint pxremap_ip6_divert(struct netif *netif, ip6_addr_t *dst);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonint pxremap_outbound_ip6(ip6_addr_t *dst, ip6_addr_t *src);
bee2440354b4bc8796e1de0b6cbd60e1f68deba0Phill Cunningtonint pxremap_inbound_ip6(ip6_addr_t *dst, ip6_addr_t *src);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster#define pxremap_outbound_ipX(is_ipv6, dst, src) \
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster ((is_ipv6) ? pxremap_outbound_ip6(&(dst)->ip6, &(src)->ip6) \
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Madden : pxremap_outbound_ip4(&(dst)->ip4, &(src)->ip4))
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Madden
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Madden#endif /* _pxremap_h_ */
ce4d3fddc8fe2eddd68a20af9570b3cc63ece5abNeil Madden