Files | |
file | fip_if.c |
IF Access Functions. | |
file | fip_if.h |
IF Access Functions Header. | |
Defines | |
#define | fip_if_isForwardingEnabled() fip_if[fip_packet_getIfNum()].forwardingEnabled |
.routingEnabled Access Function | |
Typedefs | |
typedef fip_ds6_index_t | fip_if6_index_t |
Inherit size from generic data structures. | |
typedef fip_ds6_searchStatus_t | fip_if6_searchStatus_t |
Inherit size from generic data structures. |
#define fip_if_isForwardingEnabled | ( | ) | fip_if[fip_packet_getIfNum()].forwardingEnabled |
.routingEnabled Access Function
Referenced by fip_ip_process().
fip_return_t fip_if6_addAutoconfAddress | ( | fip_ifnum_t | ifnum, | |
unsigned char | prefixIndex, | |||
unsigned char | LLIndex | |||
) |
Add an auto-configured address based on the interface number, prefix, and link-layer address.
ifnum | ||
prefixIndex | ||
LLIndex |
References fip_ip6addr_t::addr, ADDR_AUTOCONF, fip_if6_addUnicastAddress(), fip_ip6addr_cpy, fip_ipUtils_generateAutoconfIID(), RV_OK, RV_PARAMETER_ERROR, and RV_UNKNOWN_ERROR.
Referenced by fip_if6_addPrefix(), and fip_if_addLLAddress().
fip_return_t fip_if6_addMulticastAddress | ( | fip_ifnum_t | ifnum, | |
const fip_ip6addr_t * | addr, | |||
fip_vlifetime_t | validUntil, | |||
unsigned char | PreferredLLAddrIndex, | |||
fip_bool_t | hasPreferredLLAddr | |||
) |
Add an IPv6 Unicast Address to the Addressing Table.
ifnum | Interface number to add unicast address to | |
addr | IPv6 Address to add | |
validUntil | Time (in seconds) which this address expires at, 0 is infinite | |
hasPreferredLLAddr | Does this address have a preferred link-layer address to use? | |
PreferredLLAddrIndex | Preferred Link-Layer Address to use with this address, only valid if hasPreferredLLAddr is true |
References fip_ip6addr_t::addr, ADDR_MULTICAST, ADDR_NEW, ADDR_UNUSED, fip_ip6addr_cpy, RV_MEMORY_ERROR, and RV_OK.
fip_return_t fip_if6_addPrefix | ( | fip_ifnum_t | ifnum, | |
const fip_ip6addr_t * | prefix, | |||
unsigned char | length, | |||
fip_vlifetime_t | vlifetime, | |||
fip_bool_t | advPrefix, | |||
fip_bool_t | onLink | |||
) |
Add a prefix to the active prefix list, autoconfigure addresses based on that address, and if the interface has routing enabled you have the option of advertising that prefix.
ifnum | Interface number to add prefix to. | |
prefix | Pointer to the prefix, must point to a full 16 bytes. | |
length | Length of the prefix in bits, must be multiple of 8. | |
vlifetime | Valid lifetime in seconds, zero and 0xffffffff are infinite. | |
advPrefix | Advertise prefix in RA? | |
onLink | Is prefix on-link? |
References fip_ip6addr_t::addr, fip_if6_addAutoconfAddress(), fip_memcpy_ucharLen, PREFIX_UNUSED, PREFIX_USED, RV_MEMORY_ERROR, RV_OK, and RV_PARAMETER_ERROR.
Referenced by fip_console_pref(), fip_if_init(), and fip_nd6_processRA().
fip_return_t fip_if6_addUnicastAddress | ( | fip_ifnum_t | ifnum, | |
const fip_ip6addr_t * | addr, | |||
fip_vlifetime_t | validUntil, | |||
fip_addrtype_t | addrtype, | |||
unsigned char | PreferredLLAddrIndex, | |||
fip_bool_t | hasPreferredLLAddr | |||
) |
Add an IPv6 Unicast Address to the Addressing Table.
ifnum | Interface number to add unicast address to | |
addr | IPv6 Address to add | |
validUntil | Time (in seconds) which this address expires at, 0 is infinite | |
addrtype | Type of address | |
hasPreferredLLAddr | Does this address have a preferred link-layer address to use? | |
PreferredLLAddrIndex | Preferred Link-Layer Address to use with this address, only valid if hasPreferredLLAddr is true |
References fip_ip6addr_t::addr, ADDR_NEW, ADDR_UNUSED, fip_ip6addr_cpy, RV_MEMORY_ERROR, and RV_OK.
Referenced by fip_console_addr(), and fip_if6_addAutoconfAddress().
fip_bool_t fip_if6_isDestMyMulticast | ( | fip_ifnum_t | ifnum | ) |
Check if the destination IPv6 address in the active packet is one of our multicast addresses.
This checks against any assigned multicast addresses, addresses we must be part of (ie: all-routers, all-hosts), and solicited node multicast addresses.
References ADDR_UNUSED, fip_packet_getAttr, fip_packet_getFromIP6Hdr_destPtr, fip_packet_getFromIP6Hdr_isDestMulticast, and fip_packet_setAddrFlags.
Referenced by fip_ip_process().
fip_bool_t fip_if6_isDestMyUnicast | ( | fip_ifnum_t | ifnum | ) |
Check if the destination IPv6 address in the active packet is one of our unicast addresses.
References ADDR_OPTIMISTIC, ADDR_PREFERRED, fip_packet_getFromIP6Hdr_destPtr, and fip_packet_setAttr.
Referenced by fip_ip_process(), and fip_route6_getNextHop().
void fip_if6_periodic | ( | fip_ifnum_t | ifnum | ) |
Perform periodic maintenance such as expiring IP addresses, running ND when required on our IP addresses, etc.
ifnum | Interface number to perform this maintenance on. |
References ADDR_DELETE, ADDR_NEW, ADDR_PREFERRED, fip_hostInterface_getSeconds32(), fip_nd6_periodicIf(), fip_nd6_periodicUnicast(), fip_timer_isExpired32, PREFIX_UNUSED, PREFIX_USED, and ROUTE_UNUSED.
Referenced by fip_task().
fip_return_t fip_if_addLLAddress | ( | fip_ifnum_t | ifnum, | |
fip_llptraddr_t | lladdr, | |||
fip_bool_t | preferred, | |||
fip_bool_t | validForGPAutoconf | |||
) |
Add a link-layer address to an interface.
ifnum | Interface Number to add the link-layer address | |
lladdr | Link-layer address to add | |
preferred | Is preferred address to send from on this interface | |
validForGPAutoconf | Should autoconfigure a global prefix address from this LL address if possible |
References fip_if6_addAutoconfAddress(), fip_ll_addrLenInvalid, fip_memcpy_ucharLen, PREFIX_USED, RV_OK, RV_PARAMETER_ERROR, and RV_UNHANDLED.
Referenced by fip_console_link(), and fip_if_init().
void fip_if_init | ( | fip_ifnum_t | ifnum, | |
fip_llptraddr_t | lladdr, | |||
uint16_t | defaultPacketBufSizes[], | |||
unsigned char | LLHdrSrcOffset, | |||
unsigned char | LLHdrDestOffset, | |||
char * | name, | |||
void(*)(void) | ifProcess, | |||
const fip_nd6_if_t * | nd6ptr, | |||
const unsigned char | validLLLengths[] | |||
) |
Initilize an Interface.
ifnum | Interface number to initilize | |
lladdr | Primary Link-Layer Address of Interface | |
defaultPacketBufSizes | An array of length FIP_NUMBUFS which indicates by default the amount of data to allocate for each buffer in the PacketBuf | |
LLHdrSrcOffset | Offset from start of FIP_LLBUF to Source LL Addr | |
LLHdrDestOffset | Offset from start of FIP_LLBUF to Destination LL Addr | |
name | Name of interface, not bigger than FIP_CONF_MAX_IFNAME-1 | |
ifProcess | A pointer to the periodic process to call for this function, which will be responsible for sending data out at minimum | |
validLLLengths | A pointer to an array of unsigned chars which indicates permissible Link-Layer address lengths, array is of size FIP_CONF_MAX_LLADDRS |
References fip_if6_addPrefix(), fip_if_addLLAddress(), fip_timer_getExpireTime32miliS(), RV_OK, and fip_nd6_if_t::using6LPND.