Microchip® Advanced Software Framework

ip64-addrmap.h File Reference
#include "sys/timer.h"
#include "net/ip/uip.h"

Data Structures

struct  ip64_addrmap_entry
 

Macros

#define FLAGS_NONE   0
 
#define FLAGS_RECYCLABLE   1
 

Functions

struct ip64_addrmap_entryip64_addrmap_create (const uip_ip6addr_t *ip6addr, uint16_t ip6port, const uip_ip4addr_t *ip4addr, uint16_t ip4port, uint8_t protocol)
 Create a new address mapping from an IPv6 address/port, an IPv4 address/port, and a protocol number. More...
 
void ip64_addrmap_init (void)
 Initialize the ip64_addrmap module. More...
 
struct ip64_addrmap_entryip64_addrmap_list (void)
 Obtain the list of all address mappings. More...
 
struct ip64_addrmap_entryip64_addrmap_lookup (const uip_ip6addr_t *ip6addr, uint16_t ip6port, const uip_ip4addr_t *ip4addr, uint16_t ip4port, uint8_t protocol)
 Look up an address mapping from inside the IPv6 network, given the IPv6 address/port, the IPv4 address/port, and the protocol. More...
 
struct ip64_addrmap_entryip64_addrmap_lookup_port (uint16_t mappedport, uint8_t protocol)
 Look up an address mapping from the outside IPv4 network, given the mapped port number and protocol. More...
 
void ip64_addrmap_set_lifetime (struct ip64_addrmap_entry *e, clock_time_t lifetime)
 Set the lifetime of an address mapping. More...
 
void ip64_addrmap_set_recycleble (struct ip64_addrmap_entry *e)
 Mark an address mapping to be recyclable. More...
 

#define FLAGS_NONE   0

Referenced by ip64_addrmap_create().

#define FLAGS_RECYCLABLE   1

struct ip64_addrmap_entry* ip64_addrmap_create ( const uip_ip6addr_t ip6addr,
uint16_t  ip6port,
const uip_ip4addr_t ip4addr,
uint16_t  ip4port,
uint8_t  protocol 
)
void ip64_addrmap_init ( void  )

Initialize the ip64_addrmap module.

References FIRST_MAPPED_PORT, list_init(), mapped_port, and memb_init().

struct ip64_addrmap_entry* ip64_addrmap_list ( void  )

Obtain the list of all address mappings.

References list_head().

struct ip64_addrmap_entry* ip64_addrmap_lookup ( const uip_ip6addr_t ip6addr,
uint16_t  ip6port,
const uip_ip4addr_t ip4addr,
uint16_t  ip4port,
uint8_t  protocol 
)

Look up an address mapping from inside the IPv6 network, given the IPv6 address/port, the IPv4 address/port, and the protocol.

References check_age(), ip64_addrmap_entry::ip4addr, ip64_addrmap_entry::ip4port, ip64_addrmap_entry::ip6addr, ip64_addrmap_entry::ip6port, list_head(), list_item_next(), NULL, printf, ip64_addrmap_entry::protocol, uip_htons(), uip_ip4addr_cmp, and uip_ip6addr_cmp.

Referenced by ip64_6to4().

struct ip64_addrmap_entry* ip64_addrmap_lookup_port ( uint16_t  mappedport,
uint8_t  protocol 
)

Look up an address mapping from the outside IPv4 network, given the mapped port number and protocol.

References check_age(), list_head(), list_item_next(), ip64_addrmap_entry::mapped_port, NULL, printf, and ip64_addrmap_entry::protocol.

Referenced by ip64_4to6().

void ip64_addrmap_set_lifetime ( struct ip64_addrmap_entry e,
clock_time_t  lifetime 
)

Set the lifetime of an address mapping.

References NULL, ip64_addrmap_entry::timer, and timer_set().

Referenced by ip64_6to4().

void ip64_addrmap_set_recycleble ( struct ip64_addrmap_entry e)

Mark an address mapping to be recyclable.

References ip64_addrmap_entry::flags, FLAGS_RECYCLABLE, and NULL.

Referenced by ip64_6to4().