📄 dnsr_db.h.svn-base
字号:
/***************************************************************************************
* Copyright c 2000 D-Link Corporation All rights reserved.
*
* This is unpublished proprietary source code of D-Link Corporation
*
* The copyright notice above does not evidence any actual or intended
* publication of such source code.
***************************************************************************************
*/
#ifndef __DNSR_DB_H__
#define __DNSR_DB_H__
/* INCLUDE FILE DECLARATIONS */
#include <l3/ip/inc/ip_db.h>
/*Benjamin Lee add 2006.1.18*/
#define DNSR_USE_EPM 0
#define MAX_NAME_SERVER 2
#define MAX_STATIC_DNS_NUM 16
#define HOST_IP 0
#define HOST_NAME 1
#define HOST_STATUS 2
/* TYPE DECLARATION */
typedef struct
{
UI32_T host_ip;
UI8_T host_name[255];
BOOLEAN_T status;
UI8_T reserved[16];
} DNSR_DB_Static_Table_T;
typedef struct
{
UI32_T server_addr[MAX_NAME_SERVER];
DNSR_DB_Static_Table_T static_table[MAX_STATIC_DNS_NUM];
UI8_T dns_status;
UI8_T cache_status;
UI8_T lookup_status;
UI8_T reserved[16];
} DNSR_DB_GEN_T;
typedef struct
{
DNSR_DB_GEN_T global;
} DNSR_DB_T;
/* EXPORTED SUBPROGRAM SPECIFICATIONS */
/*----------------------------------------------------------------------------
* Purpose: This funtion get device information from NV-RAM.
* Parameters:
* Input: None.
* Output: None.
* Return: eeprom section address.
*----------------------------------------------------------------------------
*/
void DNSR_DB_Init(void);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Get_Static_Table_Entry(DNSR_DB_Static_Table_T *st, UI8_T index)
* Purpose: This function gets the value of specific type of an entry in the static
* table from EEPROM.
* Params:
*
* Input: index Index of an entry in static table.
* Output: st The structure of static table with the value of specific type.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Get_Static_Table_Entry(DNSR_DB_Static_Table_T *st,
UI8_T index);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Set_Static_Table_Entry(DNSR_DB_Static_Table_T *st, UI8_T index)
* Purpose: This function sets the value of specific type of an entry in the static
* table and saves into EEPROM.
* Params:
* Input: type Type of an entry in static table, including IP, domain name, entry status.
* Input: st The structure of static table with the value of specific type.
* Input: index Index of an entry in static table.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Set_Static_Table_Entry(DNSR_DB_Static_Table_T *st,
UI8_T index);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Get_Name_Server_IP(UI32_T *ptr, UI8_T index)
* Purpose: This function gets one of name server's IP from EEPROM.
* Params:
* Input: index Index of an entry in name server table.
* Output: ptr IP adderss.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Get_Name_Server_IP(UI32_T *ptr, UI8_T index);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Set_Name_Server_IP(UI32_T addr, UI8_T index)
* Purpose: This function sets one of name server's IP and saves into EEPROM.
* Params:
* Input: addr IP adderss to be set.
* Input: index Index of an entry in name server table.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Set_Name_Server_IP(UI32_T addr, UI8_T index);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Get_Status(UI8_T *status)
* Purpose: This function gets the status of DNS Relay from EEPROM.
* Params:
* Output: status DNSR status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Get_Status(UI8_T *status);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Set_Status(UI8_T status)
* Purpose: This function sets the status of DNS Relay and saves into EEPROM.
* Params:
* Input: status DNSR status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Set_Status(UI8_T status);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Get_Cache_Status(UI8_T *status)
* Purpose: This function gets the status of cache lookup from EEPROM.
* Params:
* Output: status Cache lookup status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Get_Cache_Status(UI8_T *status);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Set_Cache_Status(UI8_T status)
* Purpose: This function sets the status of cache lookup and saves into EEPROM.
* Params:
* Input: status Cache lookup status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Set_Cache_Status(UI8_T status);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Get_Lookup_Status(UI8_T *status)
* Purpose: This function gets the status of static table lookup from EEPROM.
* Params:
* Output: status Static table lookup status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Get_Lookup_Status(UI8_T *status);
/*
*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_Set_Lookup_Status(UI8_T status)
* Purpose: This function sets the status of static table lookup and saves into EEPROM.
* Params:
* Input: status Static table lookup status.
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_Set_Lookup_Status(UI8_T status);
/*-----------------------------------------------------------------------------------------------------
* BOOLEAN_T DNSR_DB_StaticTable_Update_Item (UI8_T index)
* Purpose: This function update the total of static table and saves into EEPROM.
* Params:
* Input: UI8_T index
* Returns: BOOLEAN_T
* Notes: None
*-----------------------------------------------------------------------------------------------------
*/
BOOLEAN_T DNSR_DB_StaticTable_Update_Item (UI8_T index);
/* End of DNS Relay Package */
#endif /* __DNSR_DB_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -