AzureMXChip/MXCHIPAZ3166/core/lib/netxduo/addons/pppoe/nx_pppoe_server.c
UINT  _nx_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))
{
                  
    /* Obtain the IP internal mutex before processing the IP event.  */
    tx_mutex_get(&(pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);

    /* Install PPPoE notify function pointer */
    pppoe_server_ptr -> nx_pppoe_discover_initiation_notify = pppoe_discover_initiation_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_request_notify = pppoe_discover_request_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_terminate_notify = pppoe_discover_terminate_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_terminate_confirm = pppoe_discover_terminate_confirm; 
    pppoe_server_ptr -> nx_pppoe_data_receive_notify = pppoe_data_receive_notify; 
    pppoe_server_ptr -> nx_pppoe_data_send_notify = pppoe_data_send_notify;     

    /* Release the IP internal mutex.  */
    tx_mutex_put(&(pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection));

    /* Return success.  */
    return(NX_PPPOE_SERVER_SUCCESS);
}
/**************************************************************************/
/*                                                                        */
/*  FUNCTION                                               RELEASE        */
/*                                                                        */
/*    _nx_pppoe_server_callback_notify_set                PORTABLE C      */
/*                                                           6.1          */
/*  AUTHOR                                                                */
/*                                                                        */
/*    Yuxin Zhou, Microsoft Corporation                                   */
/*                                                                        */
/*  DESCRIPTION                                                           */
/*                                                                        */
/*    This function sets the callback notify functions.                   */
/*                                                                        */
/*  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                                                                 */
/*                                                                        */
/*    tx_mutex_get                          Obtain a protection mutex     */
/*    tx_mutex_put                          Release protection mutex      */
/*                                                                        */
/*  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

_nx_pppoe_server_callback_notify_set                PORTABLE C
6.1
AUTHOR

Yuxin Zhou, Microsoft Corporation

DESCRIPTION

This function sets the callback notify functions.

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

tx_mutex_get                          Obtain a protection mutex
tx_mutex_put                          Release protection mutex

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 _nx_pppoe_server_callback_notify_set PORTABLE C 6 . 1 AUTHOR Yuxin Zhou Microsoft Corporation DESCRIPTION This function sets the callback notify functions . 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 tx_mutex_get Obtain a protection mutex tx_mutex_put Release protection mutex 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  _nx_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))
{
    tx_mutex_get(&(pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection), TX_WAIT_FOREVER);
    pppoe_server_ptr -> nx_pppoe_discover_initiation_notify = pppoe_discover_initiation_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_request_notify = pppoe_discover_request_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_terminate_notify = pppoe_discover_terminate_notify; 
    pppoe_server_ptr -> nx_pppoe_discover_terminate_confirm = pppoe_discover_terminate_confirm; 
    pppoe_server_ptr -> nx_pppoe_data_receive_notify = pppoe_data_receive_notify; 
    pppoe_server_ptr -> nx_pppoe_data_send_notify = pppoe_data_send_notify;     
    tx_mutex_put(&(pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection));
    return(NX_PPPOE_SERVER_SUCCESS);
}
UINT _nx_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 ) ) { tx_mutex_get ( & ( pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection ) , TX_WAIT_FOREVER ) ; pppoe_server_ptr -> nx_pppoe_discover_initiation_notify = pppoe_discover_initiation_notify ; pppoe_server_ptr -> nx_pppoe_discover_request_notify = pppoe_discover_request_notify ; pppoe_server_ptr -> nx_pppoe_discover_terminate_notify = pppoe_discover_terminate_notify ; pppoe_server_ptr -> nx_pppoe_discover_terminate_confirm = pppoe_discover_terminate_confirm ; pppoe_server_ptr -> nx_pppoe_data_receive_notify = pppoe_data_receive_notify ; pppoe_server_ptr -> nx_pppoe_data_send_notify = pppoe_data_send_notify ; tx_mutex_put ( & ( pppoe_server_ptr -> nx_pppoe_ip_ptr -> nx_ip_protection ) ) ; return ( NX_PPPOE_SERVER_SUCCESS ) ; }
FUNCTION                                               RELEASE
FUNCTION RELEASE
/* Obtain the IP internal mutex before processing the IP event.  */ /* Install PPPoE notify function pointer */ /* Release the IP internal mutex.  */ /* Return success.  */