/****************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only * intended for use with Renesas products. No other uses are authorized. * This software is owned by Renesas Electronics Corporation and is protected * under all applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software * and to discontinue the availability of this software. By using this software, * you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer ******************************************************************************* * Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved. ******************************************************************************* * File Name : ipCache.h * Version : 1.00 * Description : IPV4 address cache functions ****************************************************************************** * History : DD.MM.YYYY Version Description * : 01.02.2011 1.00 First Release ******************************************************************************/ #ifndef IPCACHE_FILE_H #define IPCACHE_FILE_H #ifdef __cplusplus extern "C" { #endif /****************************************************************************** Includes , "Project Includes" ******************************************************************************/ #include "r_typedefs.h" /****************************************************************************** Typedef definitions ******************************************************************************/ typedef uint32_t IPADR, *PIPADR; typedef struct _IPCACHE *PIPCACHE; /****************************************************************************** Functions Prototypes ******************************************************************************/ /****************************************************************************** * Function Name: icCreate * Description : Function to create an IP address cache * Arguments : IN uiCacheSize - The number of entries to keep in the cache * Return Value : Pointer to the cache or NULL on error ******************************************************************************/ extern PIPCACHE icCreate(uint32_t uiCacheSize); /****************************************************************************** * Function Name: icDestroy * Description : Function to destroy an IP address cache * Arguments : IN pIpCache - Pointer to the IP address cache * Return Value : none ******************************************************************************/ extern void icDestroy(PIPCACHE pIpCache); /****************************************************************************** * Function Name: icAdd * Description : Function to add an address to the cache * Arguments : IN pIpCache - Pointer to the IP address cache * IN pIP - Pointer to the IP address to add * Return Value : none ******************************************************************************/ extern void icAdd(PIPCACHE pIpCache, PIPADR pIP); /****************************************************************************** * Function Name: icRemove * Description : Function to remove an address from the cache * Arguments : IN pIpCache - Pointer to the IP address cache * IN pIP - Pointer to the IP address to remove * Return Value : none ******************************************************************************/ extern void icRemove(PIPCACHE pIpCache, PIPADR pIP); /****************************************************************************** * Function Name: icPurge * Description : Function to purge the cache * Arguments : IN pIpCache - Pointer to the IP address cache * Return Value : none ******************************************************************************/ extern void icPurge(PIPCACHE pIpCache); /****************************************************************************** * Function Name: icSearch * Description : Function to search the cache * Arguments : IN pIpCache - Pointer to the IP address cache * IN pIP - Pointer to the IP address to search * Return Value : true if the entry is found ******************************************************************************/ extern _Bool icSearch(PIPCACHE pIpCache, PIPADR pIP); #ifdef __cplusplus } #endif #endif /* IPCACHE_FILE_H */ /****************************************************************************** End of file ******************************************************************************/