tfArpFlush

Jump to: navigation, search

Table of Contents >> Programmer's Reference


#include <trsocket.h>


int tfArpFlush (int af);


Note Note: You MUST define TM_USE_ARP_FLUSH in your trsystem.h file for this function to be available.


Function Description

This function allows the user to flush the ARP cache table for a given address family or set of address families. For the passed address family/families, all IP address to link layer address mappings will be removed or invalidated in the ARP cache including the ARP cache entries manually added by the user.


Parameters

  • af
    The address family to flush: AF_INET for IPv4, AF_INET6 for IPv6, or (AF_INET|AF_INET6) for both families.


Returns

  • TM_ENOERROR
    The ARP cache table has successfully been flushed for the given address family/families.
  • TM_EINVAL
    Invalid address family.


Example Usage

/*
 * Remove/Invalidate all IPv4 to link layer
 * addresses mappings from the ARP cache table.
 */
errorCode = tfArpFlush(AF_INET); 
 
/* 
 * Remove/Invalidate all IPv6 to link layer
 * addresses mappings from the ARP cache table.
 */
errorCode = tfArpFlush(AF_INET6); 
 
/* 
 * Remove/Invalidate all IPv4 and IPv6 to link
 * layer addresses mappings from the ARP cache table.
 */
errorCode = tfArpFlush(AF_INET|AF_INET6);

Table of Contents >> Programmer's Reference