AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/addons/pppoe/nx_pppoe_server.c
UINT  _nxe_pppoe_server_callback_notify_set(NX_PPPOE_SERVER *pppoe_server_ptr, 
                                            VOID (* pppoe_discover_initiation_notify)(UINT session_index), 
                                            VOID (* pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data),
                                            VOID (* pppoe_discover_terminate_notify)(UINT session_index),
                                            VOID (* pppoe_discover_terminate_confirm)(UINT session_index),
                                            VOID (* pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id),
                                            VOID (* pppoe_data_send_notify)(UINT session_index, UCHAR *data))
{

UINT    status;

    /* Check for invalid input pointers.  */
    if ((pppoe_server_ptr == NX_NULL) || (pppoe_server_ptr -> nx_pppoe_id != NX_PPPOE_SERVER_ID))
        return(NX_PPPOE_SERVER_PTR_ERROR);

    /* Check to see if pppoe_data_receive_notify is set.  */
    if (pppoe_data_receive_notify == NX_NULL) 
        return(NX_PPPOE_SERVER_PTR_ERROR);

    /* Call actual PPPoE service callback notify set function.  */
    status =  _nx_pppoe_server_callback_notify_set(pppoe_server_ptr, pppoe_discover_initiation_notify, pppoe_discover_request_notify,
                                                   pppoe_discover_terminate_notify, pppoe_discover_terminate_confirm,
                                                   pppoe_data_receive_notify, pppoe_data_send_notify); 

    /* Return completion status.  */
    return(status);
}
/**************************************************************************/
/*                                                                        */
/*  FUNCTION                                               RELEASE        */
/*                                                                        */
/*    _nxe_pppoe_server_callback_notify_set               PORTABLE C      */
/*                                                           6.1          */
/*  AUTHOR                                                                */
/*                                                                        */
/*    Yuxin Zhou, Microsoft Corporation                                   */
/*                                                                        */
/*  DESCRIPTION                                                           */
/*                                                                        */
/*    This function checks for errors in the PPPoE Server disable function*/
/*    call.                                                               */
/*                                                                        */
/*  INPUT                                                                 */
/*                                                                        */
/*    pppoe_server_ptr                      Pointer to PPPoE control block*/
/*    pppoe_discover_initiation_notify      Routine to call when discovery*/
/*                                            initiation data is received */
/*    pppoe_discover_request_notify         Routine to call when discovery*/
/*                                            reques data is received     */
/*    pppoe_discover_terminate_notify       Routine to call when discovery*/
/*                                            terminate data is received  */
/*    pppoe_discover_terminate_confirm      Routine to call when discovery*/
/*                                            terminate data is sent      */
/*    pppoe_data_receive_notify             Routine to call when session  */
/*                                            data is received            */
/*    pppoe_data_send_notify                Routine to call when session  */
/*                                            data is sent                */
/*                                                                        */
/*  OUTPUT                                                                */
/*                                                                        */
/*    status                                Completion status             */
/*                                                                        */
/*  CALLS                                                                 */
/*                                                                        */
/*    _nx_pppoe_server_callback_notify_set  Actual PPPoE callback set     */
/*                                            function                    */
/*                                                                        */
/*  CALLED BY                                                             */
/*                                                                        */
/*    Application                                                         */
/*                                                                        */
/*  RELEASE HISTORY                                                       */
/*                                                                        */
/*    DATE              NAME                      DESCRIPTION             */
/*                                                                        */
/*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
/*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
/*                                            resulting in version 6.1    */
/*                                                                        */
/**************************************************************************/
FUNCTION                                               RELEASE

_nxe_pppoe_server_callback_notify_set               PORTABLE C
6.1
AUTHOR

Yuxin Zhou, Microsoft Corporation

DESCRIPTION

This function checks for errors in the PPPoE Server disable function
call.

INPUT

pppoe_server_ptr                      Pointer to PPPoE control block
pppoe_discover_initiation_notify      Routine to call when discovery
initiation data is received
pppoe_discover_request_notify         Routine to call when discovery
reques data is received
pppoe_discover_terminate_notify       Routine to call when discovery
terminate data is received
pppoe_discover_terminate_confirm      Routine to call when discovery
terminate data is sent
pppoe_data_receive_notify             Routine to call when session
data is received
pppoe_data_send_notify                Routine to call when session
data is sent

OUTPUT

status                                Completion status

CALLS



CALLED BY

Application

RELEASE HISTORY

DATE              NAME                      DESCRIPTION

05-19-2020     Yuxin Zhou               Initial Version 6.0
09-30-2020     Yuxin Zhou               Modified comment(s),
resulting in version 6.1
FUNCTION RELEASE _nxe_pppoe_server_callback_notify_set PORTABLE C 6 . 1 AUTHOR Yuxin Zhou Microsoft Corporation DESCRIPTION This function checks for errors in the PPPoE Server disable function call . INPUT pppoe_server_ptr Pointer to PPPoE control block pppoe_discover_initiation_notify Routine to call when discovery initiation data is received pppoe_discover_request_notify Routine to call when discovery reques data is received pppoe_discover_terminate_notify Routine to call when discovery terminate data is received pppoe_discover_terminate_confirm Routine to call when discovery terminate data is sent pppoe_data_receive_notify Routine to call when session data is received pppoe_data_send_notify Routine to call when session data is sent OUTPUT status Completion status CALLS CALLED BY Application RELEASE HISTORY DATE NAME DESCRIPTION 05 - 19 - 2020 Yuxin Zhou Initial Version 6 . 0 09 - 30 - 2020 Yuxin Zhou Modified comment ( s ) resulting in version 6 . 1
UINT  _nxe_pppoe_server_callback_notify_set(NX_PPPOE_SERVER *pppoe_server_ptr, 
                                            VOID (* pppoe_discover_initiation_notify)(UINT session_index), 
                                            VOID (* pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data),
                                            VOID (* pppoe_discover_terminate_notify)(UINT session_index),
                                            VOID (* pppoe_discover_terminate_confirm)(UINT session_index),
                                            VOID (* pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id),
                                            VOID (* pppoe_data_send_notify)(UINT session_index, UCHAR *data))
{
UINT    status;
    if ((pppoe_server_ptr == NX_NULL) || (pppoe_server_ptr -> nx_pppoe_id != NX_PPPOE_SERVER_ID))
        return(NX_PPPOE_SERVER_PTR_ERROR);
    if (pppoe_data_receive_notify == NX_NULL) 
        return(NX_PPPOE_SERVER_PTR_ERROR);
    status =  _nx_pppoe_server_callback_notify_set(pppoe_server_ptr, pppoe_discover_initiation_notify, pppoe_discover_request_notify,
                                                   pppoe_discover_terminate_notify, pppoe_discover_terminate_confirm,
                                                   pppoe_data_receive_notify, pppoe_data_send_notify); 
    return(status);
}
UINT _nxe_pppoe_server_callback_notify_set ( NX_PPPOE_SERVER * pppoe_server_ptr , VOID ( * pppoe_discover_initiation_notify ) ( UINT session_index ) , VOID ( * pppoe_discover_request_notify ) ( UINT session_index , ULONG length , UCHAR * data ) , VOID ( * pppoe_discover_terminate_notify ) ( UINT session_index ) , VOID ( * pppoe_discover_terminate_confirm ) ( UINT session_index ) , VOID ( * pppoe_data_receive_notify ) ( UINT session_index , ULONG length , UCHAR * data , UINT packet_id ) , VOID ( * pppoe_data_send_notify ) ( UINT session_index , UCHAR * data ) ) { UINT status ; if ( ( pppoe_server_ptr == NX_NULL ) || ( pppoe_server_ptr -> nx_pppoe_id != NX_PPPOE_SERVER_ID ) ) return ( NX_PPPOE_SERVER_PTR_ERROR ) ; if ( pppoe_data_receive_notify == NX_NULL ) return ( NX_PPPOE_SERVER_PTR_ERROR ) ; status = _nx_pppoe_server_callback_notify_set ( pppoe_server_ptr , pppoe_discover_initiation_notify , pppoe_discover_request_notify , pppoe_discover_terminate_notify , pppoe_discover_terminate_confirm , pppoe_data_receive_notify , pppoe_data_send_notify ) ; return ( status ) ; }
FUNCTION                                               RELEASE
FUNCTION RELEASE
/* Check for invalid input pointers.  */ /* Check to see if pppoe_data_receive_notify is set.  */ /* Call actual PPPoE service callback notify set function.  */ /* Return completion status.  */