Files
m241Neelima/components/ip_net2-6.9/ipdhcpr/include/ipdhcpr.h
T
2026-07-30 11:19:44 +05:30

383 lines
9.5 KiB
C

/* ipdhcpr.h - API of DHCP Relay Agent */
/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipdhcpr.h,v $ $Revision: 1.8 $
* $Source: /home/interpeak/CVSRoot/ipdhcpr/include/ipdhcpr.h,v $
* $Author: fguo $ $Date: 2010-07-09 11:36:41 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Jonas Rendel <jonas@interpeak.se>
******************************************************************************
*/
#ifndef IPDHCPR_H
#define IPDHCPR_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
DESCRIPTION
This library contains the API for DHCP Relay Agent
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_cstyle.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#define IPDHCPR_RELEASE 60600
/*
*===========================================================================
* DHCPR Eternity constant
*===========================================================================
* To be used for setting certain timer constanst in ipdhcpr_config.h
*/
#define IPDHCPR_ETERNITY 0xffffffff
/*
*===========================================================================
* DHCP hardware types
*===========================================================================
* Hardware types handled by the IPDHCPR.
*/
#define IPDHCPR_HWTYPE_ETHERNET 1
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
*===========================================================================
* Ipdhcpr_open
*===========================================================================
*/
typedef struct Ipdhcpr_open_struct
{
Ip_u32 api_version; /* Currently version 1. Used for future compability. */
}
Ipdhcpr_open;
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* Ipdhcpr_init
*===========================================================================
* Description: Initiate IPDHPCR
* Parameters:
* Returns: IPCOM_SUCCESS - success
* other - failure
*/
IP_PUBLIC Ip_err ipdhcpr_create(void);
/*
*===========================================================================
* Ipdhcpr_exit
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_PUBLIC Ip_err ipdhcpr_start(void);
/*
*===========================================================================
* ipdhpcr_version
*===========================================================================
* Description:
* Parameters:
* Returns:
*
*/
IP_PUBLIC const char *ipdhcpr_version(void);
/*******************************************************************************
*
* ipdhcpr_interface_status_set - set the status of an interface handled by IPDHCPR
*
* This routine sets the status of an interface handled by IPDHCPR. The interface
* is specified by its name.
*
* Parameters:
* \is
* \i <ifname>
* Name of interface.
* \i <status>
* Enable ('IP_TRUE') or disable ('IP_FALSE') the interface.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or the following error:
* \is
* \i 'IPCOM_ERR_NOT_FOUND'
* No interface with specified name found.
* \ie
*
* ERRNO:
*/
IP_GLOBAL Ip_err ipdhcpr_interface_status_set
(
char* ifname,
Ip_bool status
);
/*******************************************************************************
*
* ipdhcpr_interface_option82 - set the circuit ID or remote ID handled by IPDHCPR
*
* This routine configure the circuit ID or remote ID for a specied interface.
*
* Parameter:
* \is
* \i <ifname>
* Name of interface.
* \i <circuit_id>
* The circuit identifier string for option82.
* \i <remote_id>
* The remote identifier string for option82.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or one of the following errors:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \i 'IPCOM_ERR_NOT_FOUND'
* Server does not exist.
* \i 'IPCOM_ERR_NO_MEMORY'
* Out of memory.
* \i 'IPCOM_ERR_INVALID_ARG'
* Invalid address.
* \ie
*
* ERRNO:
*/
IP_PUBLIC Ip_err ipdhcpr_interface_option82
(
char* ifname,
char* circuit_id,
char *remote_id
);
/*******************************************************************************
*
* ipdhcpr_option82_auth_set - set the status of authentication handled by IPDHCPR
*
* This routine sets the status of option82 authentication handled by IPDHCPR.
*
* Parameters:
* \is
* \i <status>
* Enable ('IP_TRUE') or disable ('IP_FALSE') the option82 authentication.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or the following error:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \ie
*
* ERRNO:
*/
IP_GLOBAL Ip_err ipdhcpr_option82_auth_set
(
Ip_bool status
);
/*******************************************************************************
*
* ipdhcpr_interface_status_set - set the status of drop policy handled by IPDHCPR
*
* This routine sets the status of drop policy handled by IPDHCPR.
*
* Parameters:
* \is
* \i <status>
* Enable ('IP_TRUE') or disable ('IP_FALSE') the option82 drop policy.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or the following error:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \ie
*
* ERRNO:
*/
IP_GLOBAL Ip_err ipdhcpr_option82_drop_set
(
Ip_bool status
);
/*******************************************************************************
*
* ipdhcpr_server_option82 - Configure share key of option82 AUTH suboption.
*
* This routine configure a share key of option82 AUTH suboption to the DHCP
* relay agent.
*
* Parameter:
* \is
* \i <addr>
* IPv4 address of server in network byte order.
* \i <auth>
* Enable ('IP_TRUE') or disable ('IP_FALSE') authentication on a server.
* \i <auth_key>
* authentication share key string.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or one of the following errors:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \i 'IPCOM_ERR_NOT_FOUND'
* Server does not exist.
* \i 'IPCOM_ERR_NO_MEMORY'
* Out of memory.
* \ie
*
* ERRNO:
*/
IP_PUBLIC Ip_err ipdhcpr_server_option82
(
Ip_u32 addr,
Ip_bool auth,
char *auth_key
);
/*******************************************************************************
*
* ipdhcpr_server_add - add a new server address to the DHCP relay agent
*
* This routine adds a new server address to the DHCP relay agent configuration.
*
* Parameter:
* \is
* \i <addr>
* IPv4 address of server in network byte order.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or one of the following errors:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \i 'IPCOM_ERR_ALREADY_INSTALLED'
* Server already exists.
* \i 'IPCOM_ERR_NO_MEMORY'
* Out of memory.
* \ie
*
* ERRNO:
*/
IP_PUBLIC Ip_err ipdhcpr_server_add
(
Ip_u32 addr
);
/*******************************************************************************
*
* ipdhcpr_server_delete - delete a server address
*
* Delete a server address from the DHCP relay agent configuration.
*
* Parameter:
* \is
* \i <addr>
* IPv4 address of server in network byte order.
* \ie
*
* RETURNS: Either 'IPCOM_SUCCESS', or one of the following errors:
* \is
* \i 'IPCOM_ERR_NOT_OPENED'
* IPDHCPR not started.
* \i 'IPCOM_ERR_NOT_FOUND'
* Server does not exist.
* \i 'IPCOM_ERR_INVALID_ARG'
* Invalid address.
* \ie
*
* ERRNO:
*/
IP_PUBLIC Ip_err ipdhcpr_server_delete
(
Ip_u32 addr
);
/*
*===========================================================================
* Ipdhcpr_cmd_dhcpr
*===========================================================================
* Description: Install IPDHCPR shell commands
* Parameters:
* Returns:
*
*/
#ifdef IPDHCPR_INCLUDE_CMD
IP_GLOBAL int ipdhcpr_cmd_dhcpr(int argc, char **argv);
#endif
/*
*===========================================================================
* ipdhcpr_user_start_hook
*===========================================================================
* Description: Routine with user supplied code called at startup of IPDHCPR.
* It can be used for adding configuration to IPDHCPR etc. etc.
* Parameters: -
* Returns: 0 - success
* -1 - failure
*
*/
IP_GLOBAL int
ipdhcpr_start_hook(void);
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/