Files
m241Neelima/components/ip_net2-6.9/ipwps/src/ipwps_credentials.h
T
2026-07-30 11:19:44 +05:30

226 lines
6.8 KiB
C

/* ipwps_credentials.h - IPWPS Credentials module header file */
/*
* Copyright (c) 2009 Wind River Systems, Inc.
*
* The right to copy, distribute, modify, or otherwise make use
* of this software may be licensed only pursuant to the terms
* of an applicable Wind River license agreement.
*
*/
/*
modification history
--------------------
01a,28Apr09,mry Created
*/
#ifndef IPWPS_CREDENTIALS_H
#define IPWPS_CREDENTIALS_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#include <ipcom_type.h>
#include <ipcom_cstyle.h>
#include "ipwps_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
#define IPWPS_CREDENTIAL_AP_SETID 0
#define IPWPS_CREDENTIAL_BULTIN_REG_SETID 1
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
typedef enum {
IPWPS_CREDENTIAL_ADD,
IPWPS_CREDENTIAL_DELETE
} Ipwps_credential_notify_type;
typedef void (*Ipwps_credentials_notify_fn)(struct Ipwps_ctx_st* ctx, Ip_u16 setid, Ipwps_credential_notify_type ntype);
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
/*
*===========================================================================
* ipwps_credentials_init
*===========================================================================
* Description:
* Initialize the IPWPS Credentials module.
* Called by the core module in the ipwpsd context BEFORE the wps application
* init functions are called.
* Parameters:
* Ipwps_ctx* ctx - A valid configured wps context.
* Returns:
* IPCOM_SUCCESS upon success, otherwise a failure indication
*/
IP_GLOBAL Ip_err ipwps_credentials_init
(
struct Ipwps_ctx_st* ctx
);
/*
*===========================================================================
* ipwps_credentials_shutdown
*===========================================================================
* Description:
* Shutdown the IPWPS Credentials module.
* Called by the core module in the ipwpsd context when shut down or reconfigured.
* Parameters:
* Ipwps_ctx* ctx - A valid configured wps context.
* Returns:
* IPCOM_SUCCESS upon success, otherwise a failure indication
*/
IP_GLOBAL Ip_err ipwps_credentials_shutdown
(
struct Ipwps_ctx_st* ctx
);
/*
*===========================================================================
* ipwps_credentials_clear
*===========================================================================
* Description:
* Clear the IPWPS Credentials.
* Called by the core module in the ipwpsd context ONLY when shutdown
* NOT when reconfigured.
* Parameters:
* Ipwps_ctx* ctx - A valid configured wps context.
* Returns:
* IPCOM_SUCCESS upon success, otherwise a failure indication
*/
IP_GLOBAL Ip_err ipwps_credentials_clear
(
struct Ipwps_ctx_st* ctx
);
/*
*===========================================================================
* ipwps_credentials_handle_event
*===========================================================================
* Description: Handle a credentials event stored in the ipwps context.
* Parameters:
* Ipwps_ctx* ctx - A valid Ready wps context.
* Returns:
* IPCOM_SUCCESS if successful, an error indication otherwise.
*/
IP_GLOBAL Ip_err ipwps_credentials_handle_event
(
struct Ipwps_ctx_st *ctx
);
/*
*===========================================================================
* ipwps_credentials_notify_register
*===========================================================================
* Description: Register a notification function that will be called when
* a credential set is added or deleted.
* Parameters:
* Ipwps_ctx* ctx - A valid Ready wps context.
* Ipwps_credentials_notify_fn notify_fn - Notification fn to register.
* Returns:
*
*/
IP_GLOBAL Ip_err ipwps_credentials_notify_register(
Ipwps_ctx* ctx,
Ipwps_credentials_notify_fn notify_fn
);
/*
*===========================================================================
* ipwps_credentials_notify_deregister
*===========================================================================
* Description: Deregister a credential notification function.
* Parameters:
* Ipwps_ctx* ctx - A valid Ready wps context.
* Ipwps_credentials_notify_fn notify_fn - Notification fn to deregister.
* Returns:
*
*/
IP_GLOBAL Ip_err ipwps_credentials_notify_deregister
(
Ipwps_ctx* ctx,
Ipwps_credentials_notify_fn notify_fn
);
/*
*===========================================================================
* ipwps_credentials_mark_registrar_cred
*===========================================================================
* Description: Set/reset the "donotoffer" flag for the specified registrar
* credential
* Parameters:
* Ipwps_ctx* ctx - A valid Ready wps context.
* Ip_u16 cred_set - Registrar credential Set (0..IPWPS_NUM_CEDENTIALS_MAX-1)
* Ip_bool donotoffer - Specify whether to set the flag to IP_TRUE or IP_FALSE.
* If set to IP_TRUE, the credential set will not be offered to the enrollee
* in the M8 message.
* Returns:
*
*/
IP_GLOBAL Ip_err ipwps_credentials_mark_registrar_cred
(
Ipwps_ctx* ctx,
Ip_u16 cred_set,
Ip_bool donotoffer
);
/*
*===========================================================================
* ipwps_credentials_unmark_all_registrar_creds
*===========================================================================
* Description: Reset the "donotoffer" flag for all registrar credentials
* Parameters:
* Ipwps_ctx* ctx - A valid Ready wps context.
* Returns:
*
*/
IP_GLOBAL Ip_err ipwps_credentials_unmark_all_registrar_creds
(
Ipwps_ctx* ctx
);
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/
#ifdef __cplusplus
}
#endif
#endif