1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Component                                                        */
16 /**                                                                       */
17 /**   PPP Over Ethernet (PPPoE)                                           */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 
23 /**************************************************************************/
24 /*                                                                        */
25 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
26 /*                                                                        */
27 /*    nx_pppoe_server.h                                   PORTABLE C      */
28 /*                                                           6.1.9        */
29 /*  AUTHOR                                                                */
30 /*                                                                        */
31 /*    Yuxin Zhou, Microsoft Corporation                                   */
32 /*                                                                        */
33 /*  DESCRIPTION                                                           */
34 /*                                                                        */
35 /*    This file defines the NetX PPP Over Ethernet (PPPoE) Server         */
36 /*    componet, including all data types and external references. It is   */
37 /*    assumed that nx_api.h and nx_port.h have already been included.     */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  05-19-2020     Yuxin Zhou               Initial Version 6.0           */
44 /*  09-30-2020     Yuxin Zhou               Modified comment(s),          */
45 /*                                            resulting in version 6.1    */
46 /*  02-02-2021     Yuxin Zhou               Modified comment(s),          */
47 /*                                            fixed the compiler errors,  */
48 /*                                            resulting in version 6.1.4  */
49 /*  10-15-2021     Yuxin Zhou               Modified comment(s), included */
50 /*                                            necessary header file,      */
51 /*                                            resulting in version 6.1.9  */
52 /*                                                                        */
53 /**************************************************************************/
54 
55 #ifndef NX_PPPOE_SERVER_H
56 #define NX_PPPOE_SERVER_H
57 
58 /* Determine if a C++ compiler is being used.  If so, ensure that standard
59    C is used to process the API information.  */
60 
61 #ifdef   __cplusplus
62 
63 /* Yes, C++ compiler is present.  Use standard C.  */
64 extern   "C" {
65 
66 #endif
67 
68 #include "nx_api.h"
69 
70 /* Note: Prerequisite for using PPPoE.
71          Redefine NX_PHYSICAL_HEADER to 24 to ensure enough space for filling in physical header.
72          Physical header:14(Ethernet header) + 6(PPPoE header) + 2(PPP header) + 2(four-byte aligment).  */
73 
74 /* Define the Driver command for PPPoE packet.  */
75 #ifndef NX_LINK_PPPOE_DISCOVERY_SEND
76 #define NX_LINK_PPPOE_DISCOVERY_SEND 51
77 #endif
78 #ifndef NX_LINK_PPPOE_SESSION_SEND
79 #define NX_LINK_PPPOE_SESSION_SEND   52
80 #endif
81 
82 /* Define the PPPoE Server ID.  */
83 #define NX_PPPOE_SERVER_ID                                  0x50505045UL
84 
85 /* Enable the feature to control the session established.  */
86 /*
87 #define NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
88 */
89 
90 /* If the driver is not initialized in other module, enable the feature to initialize the driver in PPPoE module .  */
91 /*
92 #define NX_PPPOE_SERVER_INITIALIZE_DRIVER_ENABLE
93 */
94 
95 /* Define the PPPoE Thread time slice.  */
96 #ifndef NX_PPPOE_SERVER_THREAD_TIME_SLICE
97 #define NX_PPPOE_SERVER_THREAD_TIME_SLICE                   TX_NO_TIME_SLICE
98 #endif
99 
100 /* Define the number of pppoe clients. */
101 #ifndef NX_PPPOE_SERVER_MAX_CLIENT_SESSION_NUMBER
102 #define NX_PPPOE_SERVER_MAX_CLIENT_SESSION_NUMBER           10
103 #endif
104 
105 /* Define the size of pppoe Host-Uniq.  */
106 #ifndef NX_PPPOE_SERVER_MAX_HOST_UNIQ_SIZE
107 #define NX_PPPOE_SERVER_MAX_HOST_UNIQ_SIZE                  32
108 #endif
109 
110 /* Define the size of pppoe Relay-Session-Id.  */
111 #ifndef NX_PPPOE_SERVER_MAX_RELAY_SESSION_ID_SIZE
112 #define NX_PPPOE_SERVER_MAX_RELAY_SESSION_ID_SIZE           12
113 #endif
114 
115 /* Define the minimum size of packet payload to avoid packet chained. Maximum Payload Size of Ethernet(1500) + Ethernet Header + CRC + Four-byte alignment.  */
116 
117 #ifndef NX_PPPOE_SERVER_MIN_PACKET_PAYLOAD_SIZE
118 #define NX_PPPOE_SERVER_MIN_PACKET_PAYLOAD_SIZE             1520
119 #endif
120 
121 /* The time out in timer ticks on allocating packets or appending data into packets.  */
122 #ifndef NX_PPPOE_SERVER_PACKET_TIMEOUT
123 #define NX_PPPOE_SERVER_PACKET_TIMEOUT                      (NX_IP_PERIODIC_RATE)           /* 1 second  */
124 #endif
125 
126 /* Set the start Session ID for assigning to the PPPoE session. */
127 #ifndef NX_PPPOE_SERVER_START_SESSION_ID
128 #define NX_PPPOE_SERVER_START_SESSION_ID                    0x4944
129 #endif
130 
131 /* Define PPPoE ethernet header size.  */
132 #define NX_PPPOE_SERVER_ETHER_HEADER_SIZE                   14
133 
134 /* Define PPPoE ethernet types.  */
135 #define NX_PPPOE_SERVER_ETHER_TYPE_DISCOVERY                0x8863
136 #define NX_PPPOE_SERVER_ETHER_TYPE_SESSION                  0x8864
137 
138 /* Define PPPoE version and type.   */
139 #define NX_PPPOE_SERVER_VERSION_TYPE                        0x11     /* Version 1, Type 1.  */
140 
141 /* Define PPPoE codes.   */
142 #define NX_PPPOE_SERVER_CODE_ZERO                           0x00
143 #define NX_PPPOE_SERVER_CODE_PADI                           0x09
144 #define NX_PPPOE_SERVER_CODE_PADO                           0x07
145 #define NX_PPPOE_SERVER_CODE_PADR                           0x19
146 #define NX_PPPOE_SERVER_CODE_PADS                           0x65
147 #define NX_PPPOE_SERVER_CODE_PADT                           0xa7
148 
149 /* Define the PPPoE Area Offsets.  */
150 #define NX_PPPOE_SERVER_OFFSET_VER_TYPE                     0       /* 1 byte, version + type: 0x11                     */
151 #define NX_PPPOE_SERVER_OFFSET_CODE                         1       /* 1 byte, code: Discovery or Session               */
152 #define NX_PPPOE_SERVER_OFFSET_SESSION_ID                   2       /* 2 bytes, session id: unique session identifieer  */
153 #define NX_PPPOE_SERVER_OFFSET_LENGTH                       4       /* 2 bytes, length: the length of PPPoE payload     */
154 #define NX_PPPOE_SERVER_OFFSET_PAYLOAD                      6       /* variable, payload                                */
155 
156 /* Define the PPPoE Tag Types.  */
157 #define NX_PPPOE_SERVER_TAG_TYPE_END_OF_LIST                0x0000
158 #define NX_PPPOE_SERVER_TAG_TYPE_SERVICE_NAME               0x0101
159 #define NX_PPPOE_SERVER_TAG_TYPE_AC_NAME                    0x0102
160 #define NX_PPPOE_SERVER_TAG_TYPE_HOST_UNIQ                  0x0103
161 #define NX_PPPOE_SERVER_TAG_TYPE_AC_COOKIE                  0x0104
162 #define NX_PPPOE_SERVER_TAG_TYPE_VENDOR_SPECIFIC            0x0105
163 #define NX_PPPOE_SERVER_TAG_TYPE_RELAY_SESSION_ID           0x0110
164 #define NX_PPPOE_SERVER_TAG_TYPE_SERVICE_NAME_ERROR         0x0201
165 #define NX_PPPOE_SERVER_TAG_TYPE_AC_SYSTEM_ERROR            0x0202
166 #define NX_PPPOE_SERVER_TAG_TYPE_GENERIC_ERROR              0x0203
167 
168 /* Define the PPPoE Error flags.  */
169 #define NX_PPPOE_SERVER_ERROR_SERVICE_NAME                  ((ULONG) 0x00000001)    /* Service Name Error.              */
170 #define NX_PPPOE_SERVER_ERROR_AC_SYSTEM                     ((ULONG) 0x00000002)    /* AC-System Error                  */
171 #define NX_PPPOE_SERVER_ERROR_GENERIC                       ((ULONG) 0x00000004)    /* Generic Error                    */
172 
173 /* Define event flags for PPPoE thread control.  */
174 #define NX_PPPOE_SERVER_ALL_EVENTS                          ((ULONG) 0xFFFFFFFF)    /* All event flags                      */
175 #define NX_PPPOE_SERVER_PACKET_RECEIVE_EVENT                ((ULONG) 0x00000001)    /* PPPoE Server receive packet event    */
176 #define NX_PPPOE_SERVER_SESSION_RECEIVE_EVENT               ((ULONG) 0x00000002)    /* PPPoE Session receive packet event   */
177 
178 /* Define error codes from PPPoE Server operation.  */
179 #define NX_PPPOE_SERVER_SUCCESS                             0x00    /* Success                                           */
180 #define NX_PPPOE_SERVER_PTR_ERROR                           0xC1    /* Invalid input pointers                            */
181 #define NX_PPPOE_SERVER_INVALID_INTERFACE                   0xC2    /* Invalid interface                                 */
182 #define NX_PPPOE_SERVER_PACKET_PAYLOAD_ERROR                0xC3    /* Invalid payload size of packet                    */
183 #define NX_PPPOE_SERVER_MEMORY_SIZE_ERROR                   0xC4    /* Invalid memory size                               */
184 #define NX_PPPOE_SERVER_PRIORITY_ERROR                      0xC5    /* Invalid priority                                  */
185 #define NX_PPPOE_SERVER_NOT_ENABLED                         0xC6    /* PPPoE is not enabled                              */
186 #define NX_PPPOE_SERVER_INVALID_SESSION                     0xC7    /* Invalid Session                                   */
187 #define NX_PPPOE_SERVER_SESSION_NOT_ESTABLISHED             0xC8    /* PPPoE Session is not established                  */
188 #define NX_PPPOE_SERVER_SERVICE_NAME_ERROR                  0xC9    /* Service name error                                */
189 #define NX_PPPOE_SERVER_AC_NAME_ERROR                       0xCA    /* AC Name error                                     */
190 #define NX_PPPOE_SERVER_CLIENT_SESSION_FULL                 0xCB    /* Client Session full                               */
191 #define NX_PPPOE_SERVER_CLIENT_SESSION_NOT_FOUND            0xCC    /* Not found the client session                      */
192 #define NX_PPPOE_SERVER_HOST_UNIQ_CACHE_ERROR               0xCD    /* The cache is not enough to record the Host Uniq   */
193 #define NX_PPPOE_SERVER_RELAY_SESSION_ID_CACHE_ERROR        0xCF    /* The cache is not enough to record Relay Session ID*/
194 
195 /* Define the PPPoE Client Session structure containing the session id and physical address.  */
196 
197 typedef struct NX_PPPOE_CLIENT_SESSION_STRUCT
198 {
199 
200     USHORT          nx_pppoe_valid;
201     USHORT          nx_pppoe_session_id;
202     ULONG           nx_pppoe_physical_address_msw;
203     ULONG           nx_pppoe_physical_address_lsw;
204     UCHAR          *nx_pppoe_service_name;
205 #ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
206     UINT            nx_pppoe_service_name_length;
207     UINT            nx_pppoe_packet_receive_stopped;
208     NX_PACKET      *nx_pppoe_deferred_received_packet_head,
209                    *nx_pppoe_deferred_received_packet_tail;
210     UCHAR          *nx_pppoe_generic_error;
211 #endif
212     UCHAR           nx_pppoe_host_uniq[NX_PPPOE_SERVER_MAX_HOST_UNIQ_SIZE];
213     UINT            nx_pppoe_host_uniq_size;
214     UCHAR           nx_pppoe_relay_session_id[NX_PPPOE_SERVER_MAX_RELAY_SESSION_ID_SIZE];
215     UINT            nx_pppoe_relay_session_id_size;
216     UINT            nx_pppoe_error_flag;
217 } NX_PPPOE_CLIENT_SESSION;
218 
219 
220 
221 /* Define the main PPPoE Server data structure.  */
222 
223 typedef struct NX_PPPOE_SERVER_STRUCT
224 {
225 
226     ULONG                       nx_pppoe_id;
227     UINT                        nx_pppoe_enabled;
228     UCHAR                      *nx_pppoe_name;
229     UINT                        nx_pppoe_name_length;
230     UCHAR                      *nx_pppoe_ac_name;
231     UINT                        nx_pppoe_ac_name_length;
232     NX_IP                      *nx_pppoe_ip_ptr;
233     NX_INTERFACE               *nx_pppoe_interface_ptr;
234     NX_PACKET_POOL             *nx_pppoe_packet_pool_ptr;
235     TX_EVENT_FLAGS_GROUP        nx_pppoe_events;
236     TX_THREAD                   nx_pppoe_thread;
237     NX_PACKET                  *nx_pppoe_deferred_received_packet_head,
238                                *nx_pppoe_deferred_received_packet_tail;
239     UCHAR                     **nx_pppoe_service_name;
240     UINT                        nx_pppoe_service_name_count;
241     USHORT                      nx_pppoe_session_id;
242     USHORT                      nx_pppoe_reserved[2];
243     NX_PPPOE_CLIENT_SESSION     nx_pppoe_client_session[NX_PPPOE_SERVER_MAX_CLIENT_SESSION_NUMBER];
244 
245     /* Define the callback nofiy function.  */
246     VOID                      (*nx_pppoe_discover_initiation_notify)(UINT session_index);
247     VOID                      (*nx_pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data);
248     VOID                      (*nx_pppoe_discover_terminate_notify)(UINT session_index);
249     VOID                      (*nx_pppoe_discover_terminate_confirm)(UINT session_index);
250     VOID                      (*nx_pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id);
251     VOID                      (*nx_pppoe_data_send_notify)(UINT session_index, UCHAR *data);
252 
253     /* Define the Link Driver entry point.  */
254     VOID                      (*nx_pppoe_link_driver_entry)(struct NX_IP_DRIVER_STRUCT *);
255 
256 } NX_PPPOE_SERVER;
257 
258 
259 #ifndef NX_PPPOE_SERVER_SOURCE_CODE
260 
261 /* Application caller is present, perform API mapping.  */
262 
263 /* Determine if error checking is desired.  If so, map API functions
264    to the appropriate error checking front-ends.  Otherwise, map API
265    functions to the core functions that actually perform the work.
266    Note: error checking is enabled by default.  */
267 
268 #ifdef NX_DISABLE_ERROR_CHECKING
269 
270 /* Services without error checking.  */
271 
272 #define nx_pppoe_server_create              _nx_pppoe_server_create
273 #define nx_pppoe_server_delete              _nx_pppoe_server_delete
274 #define nx_pppoe_server_enable              _nx_pppoe_server_enable
275 #define nx_pppoe_server_disable             _nx_pppoe_server_disable
276 #define nx_pppoe_server_callback_notify_set _nx_pppoe_server_callback_notify_set
277 #define nx_pppoe_server_ac_name_set         _nx_pppoe_server_ac_name_set
278 #define nx_pppoe_server_service_name_set    _nx_pppoe_server_service_name_set
279 #define nx_pppoe_server_session_send        _nx_pppoe_server_session_send
280 #define nx_pppoe_server_session_packet_send _nx_pppoe_server_session_packet_send
281 #define nx_pppoe_server_session_terminate   _nx_pppoe_server_session_terminate
282 #define nx_pppoe_server_session_get         _nx_pppoe_server_session_get
283 
284 #else
285 
286 /* Services with error checking.  */
287 
288 #define nx_pppoe_server_create              _nxe_pppoe_server_create
289 #define nx_pppoe_server_delete              _nxe_pppoe_server_delete
290 #define nx_pppoe_server_enable              _nxe_pppoe_server_enable
291 #define nx_pppoe_server_disable             _nxe_pppoe_server_disable
292 #define nx_pppoe_server_callback_notify_set _nxe_pppoe_server_callback_notify_set
293 #define nx_pppoe_server_ac_name_set         _nxe_pppoe_server_ac_name_set
294 #define nx_pppoe_server_service_name_set    _nxe_pppoe_server_service_name_set
295 #define nx_pppoe_server_session_send        _nxe_pppoe_server_session_send
296 #define nx_pppoe_server_session_packet_send _nxe_pppoe_server_session_packet_send
297 #define nx_pppoe_server_session_terminate   _nxe_pppoe_server_session_terminate
298 #define nx_pppoe_server_session_get         _nxe_pppoe_server_session_get
299 
300 #endif /* NX_DISABLE_ERROR_CHECKING */
301 
302 /* Define the prototypes accessible to the application software.  */
303 
304 UINT    nx_pppoe_server_create(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *name, NX_IP *ip_ptr, UINT interface_index,
305                                VOID (*pppoe_link_driver)(struct NX_IP_DRIVER_STRUCT *), NX_PACKET_POOL *pool_ptr,
306                                VOID *stack_ptr, ULONG stack_size, UINT priority);
307 UINT    nx_pppoe_server_delete(NX_PPPOE_SERVER *pppoe_server_ptr);
308 UINT    nx_pppoe_server_enable(NX_PPPOE_SERVER *pppoe_server_ptr);
309 UINT    nx_pppoe_server_disable(NX_PPPOE_SERVER *pppoe_server_ptr);
310 UINT    nx_pppoe_server_callback_notify_set(NX_PPPOE_SERVER *pppoe_server_ptr,
311                                             VOID (* pppoe_discover_initiation_notify)(UINT session_index),
312                                             VOID (* pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data),
313                                             VOID (* pppoe_discover_terminate_notify)(UINT session_index),
314                                             VOID (* pppoe_discover_terminate_confirm)(UINT session_index),
315                                             VOID (* pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id),
316                                             VOID (* pppoe_data_send_notify)(UINT session_index, UCHAR *data));
317 UINT    nx_pppoe_server_ac_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *ac_name, UINT ac_name_length);
318 UINT    nx_pppoe_server_service_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR **service_name, UINT service_name_count);
319 UINT    nx_pppoe_server_session_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, UCHAR *data_ptr, UINT data_length);
320 UINT    nx_pppoe_server_session_packet_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, NX_PACKET *packet_ptr);
321 UINT    nx_pppoe_server_session_terminate(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index);
322 UINT    nx_pppoe_server_session_get(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, ULONG *client_mac_msw, ULONG *client_mac_lsw, ULONG *session_id);
323 VOID    _nx_pppoe_server_packet_deferred_receive(NX_PACKET *packet_ptr);
324 
325 #else
326 
327 UINT    _nxe_pppoe_server_create(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *name, NX_IP *ip_ptr, UINT interface_index,
328                                  VOID (*pppoe_link_driver)(struct NX_IP_DRIVER_STRUCT *), NX_PACKET_POOL *pool_ptr,
329                                  VOID *stack_ptr, ULONG stack_size, UINT priority);
330 UINT    _nx_pppoe_server_create(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *name, NX_IP *ip_ptr, UINT interface_index,
331                                 VOID (*pppoe_link_driver)(struct NX_IP_DRIVER_STRUCT *), NX_PACKET_POOL *pool_ptr,
332                                 VOID *stack_ptr, ULONG stack_size, UINT priority);
333 UINT    _nxe_pppoe_server_delete(NX_PPPOE_SERVER *pppoe_server_ptr);
334 UINT    _nx_pppoe_server_delete(NX_PPPOE_SERVER *pppoe_server_ptr);
335 UINT    _nxe_pppoe_server_enable(NX_PPPOE_SERVER *pppoe_server_ptr);
336 UINT    _nx_pppoe_server_enable(NX_PPPOE_SERVER *pppoe_server_ptr);
337 UINT    _nxe_pppoe_server_disable(NX_PPPOE_SERVER *pppoe_server_ptr);
338 UINT    _nx_pppoe_server_disable(NX_PPPOE_SERVER *pppoe_server_ptr);
339 UINT    _nxe_pppoe_server_callback_notify_set(NX_PPPOE_SERVER *pppoe_server_ptr,
340                                               VOID (* pppoe_discover_initiation_notify)(UINT session_index),
341                                               VOID (* pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data),
342                                               VOID (* pppoe_discover_terminate_notify)(UINT session_index),
343                                               VOID (* pppoe_discover_terminate_confirm)(UINT session_index),
344                                               VOID (* pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id),
345                                               VOID (* pppoe_data_send_notify)(UINT session_index, UCHAR *data));
346 UINT    _nx_pppoe_server_callback_notify_set(NX_PPPOE_SERVER *pppoe_server_ptr,
347                                              VOID (* pppoe_discover_initiation_notify)(UINT session_index),
348                                              VOID (* pppoe_discover_request_notify)(UINT session_index, ULONG length, UCHAR *data),
349                                              VOID (* pppoe_discover_terminate_notify)(UINT session_index),
350                                              VOID (* pppoe_discover_terminate_confirm)(UINT session_index),
351                                              VOID (* pppoe_data_receive_notify)(UINT session_index, ULONG length, UCHAR *data, UINT packet_id),
352                                              VOID (* pppoe_data_send_notify)(UINT session_index, UCHAR *data));
353 UINT    _nxe_pppoe_server_ac_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *ac_name, UINT ac_name_length);
354 UINT    _nx_pppoe_server_ac_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR *ac_name, UINT ac_name_length);
355 UINT    _nxe_pppoe_server_service_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR **service_name, UINT service_name_count);
356 UINT    _nx_pppoe_server_service_name_set(NX_PPPOE_SERVER *pppoe_server_ptr, UCHAR **service_name, UINT service_name_count);
357 UINT    _nxe_pppoe_server_session_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, UCHAR *data_ptr, UINT data_length);
358 UINT    _nx_pppoe_server_session_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, UCHAR *data_ptr, UINT data_length);
359 UINT    _nxe_pppoe_server_session_packet_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, NX_PACKET *packet_ptr);
360 UINT    _nx_pppoe_server_session_packet_send(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, NX_PACKET *packet_ptr);
361 UINT    _nxe_pppoe_server_session_terminate(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index);
362 UINT    _nx_pppoe_server_session_terminate(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index);
363 UINT    _nxe_pppoe_server_session_get(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, ULONG *client_mac_msw, ULONG *client_mac_lsw, ULONG *session_id);
364 UINT    _nx_pppoe_server_session_get(NX_PPPOE_SERVER *pppoe_server_ptr, UINT session_index, ULONG *client_mac_msw, ULONG *client_mac_lsw, ULONG *session_id);
365 VOID    _nx_pppoe_server_packet_deferred_receive(NX_PACKET *packet_ptr);
366 
367 #endif /* NX_PPPOE_SERVER_SOURCE_CODE */
368 
369 #ifdef NX_PPPOE_SERVER_SESSION_CONTROL_ENABLE
370 VOID    PppInitInd(UINT length, UCHAR *aData);
371 VOID    PppDiscoverCnf(UINT length, UCHAR *aData, UINT interfaceHandle);
372 VOID    PppOpenCnf(UCHAR accept, UINT interfaceHandle);
373 VOID    PppCloseInd(UINT interfaceHandle, UCHAR *causeCode);
374 VOID    PppCloseCnf(UINT interfaceHandle);
375 VOID    PppTransmitDataCnf(UINT interfaceHandle, UCHAR *aData, UINT packet_id);
376 VOID    PppReceiveDataInd(UINT interfaceHandle, UINT length, UCHAR *aData);
377 #endif
378 
379 /* Determine if a C++ compiler is being used.  If so, complete the standard
380    C conditional started above.  */
381 #ifdef   __cplusplus
382         }
383 #endif
384 
385 #endif /* NX_PPPOE_SERVER_H */
386