Subversion Repositories Kolibri OS

Rev

Rev 2960 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2960 Rev 2961
Line 13... Line 13...
13
;;             Version 2, June 1991                             ;;
13
;;             Version 2, June 1991                             ;;
14
;;                                                              ;;
14
;;                                                              ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
17
struct  PPPoE_frame
-
 
18
 
17
struct  PPPoE_frame
19
        VersionAndType  db ?
18
        VersionAndType  db ?
20
        Code            db ?
19
        Code            db ?
21
        SessionID       dw ?
20
        SessionID       dw ?
22
        Length          dw ?            ; Length of payload, does NOT include the length PPPoE header.
21
        Length          dw ?            ; Length of payload, does NOT include the length PPPoE header.
23
        Payload         rb 0
-
 
24
 
22
        Payload         rb 0
Line -... Line 23...
-
 
23
ends
-
 
24
 
-
 
25
struct  LCP_frame
-
 
26
        Code            db ?
-
 
27
        Identifier      db ?
-
 
28
        Length          dw ?
Line 25... Line 29...
25
ends
29
        Data            rb 0
26
 
-
 
27
 
30
ends
28
uglobal
31
 
29
 
-
 
30
        PPPoE_SID       dw ?
32
uglobal
Line -... Line 33...
-
 
33
        PPPoE_SID       dw ?
-
 
34
        PPPoE_MAC       dp ?
-
 
35
endg
-
 
36
 
-
 
37
LCP_config_request      = 1
-
 
38
LCP_config_ack          = 2
-
 
39
LCP_config_nak          = 3
-
 
40
LCP_config_reject       = 4
-
 
41
LCP_terminate_request   = 5
-
 
42
LCP_terminate_ack       = 6
-
 
43
LCP_code_reject         = 7
-
 
44
LCP_protocol_reject     = 8
Line 31... Line 45...
31
        PPPoE_MAC       dp ?
45
LCP_echo_request        = 9
32
 
46
LCP_echo_reply          = 10
33
endg
47
LCP_discard_request     = 11
34
 
48
 
Line 204... Line 218...
204
        add     edx, PPPoE_frame.Payload + 2
218
        add     edx, PPPoE_frame.Payload + 2
Line 205... Line 219...
205
 
219
 
206
        cmp     ax, PPP_IPv4
220
        cmp     ax, PPP_IPv4
Line -... Line 221...
-
 
221
        je      IPv4_input
-
 
222
 
-
 
223
        cmp     ax, PPP_LCP
207
        je      IPv4_input
224
        je      LCP_input
Line 208... Line 225...
208
 
225
 
209
        DEBUGF  2,"PPPoE_input: Unknown protocol=%x\n", ax
226
        DEBUGF  2,"PPPoE_input: Unknown protocol=%x\n", ax
210
 
227
 
Line 272... Line 289...
272
 
289
 
Line -... Line 290...
-
 
290
        ret
-
 
291
 
-
 
292
 
-
 
293
 
-
 
294
 
-
 
295
;-----------------------------------------------------------------
-
 
296
;
-
 
297
; LCP_input:
-
 
298
;
-
 
299
;  IN:  Pointer to buffer in [esp]
-
 
300
;       size of buffer in [esp+4]
-
 
301
;       pointer to device struct in ebx
-
 
302
;       pointer to LCP header in edx
-
 
303
;       size of LCP packet in ecx
-
 
304
;  OUT: /
-
 
305
;
-
 
306
;-----------------------------------------------------------------
-
 
307
align 4
-
 
308
LCP_input:
-
 
309
 
-
 
310
        DEBUGF  1,"LCP_input\n"
-
 
311
 
-
 
312
        cmp     [edx + LCP_frame.Code], LCP_echo_request
-
 
313
        je      .echo
-
 
314
 
-
 
315
        jmp     .dump
-
 
316
 
-
 
317
  .echo:
-
 
318
        mov     [edx + LCP_frame.Code], LCP_echo_reply
-
 
319
        mov     esi, [esp]
-
 
320
 
-
 
321
        push    dword [esi + ETH_header.DstMAC]
-
 
322
        push    dword [esi + ETH_header.SrcMAC]
-
 
323
        pop     dword [esi + ETH_header.DstMAC]
-
 
324
        pop     dword [esi + ETH_header.SrcMAC]
-
 
325
        push    word [esi + ETH_header.DstMAC + 4]
-
 
326
        push    word [esi + ETH_header.SrcMAC + 4]
-
 
327
        pop     word [esi + ETH_header.DstMAC + 4]
-
 
328
        pop     word [esi + ETH_header.SrcMAC + 4]
-
 
329
 
-
 
330
        call    [ebx + NET_DEVICE.transmit]
-
 
331
        ret
-
 
332
 
-
 
333
  .dump:
-
 
334
        DEBUGF  2,"LCP_input: dumping\n"
-
 
335
        call    kernel_free
-
 
336
        add     esp, 4
-
 
337
        ret
273
        ret
338
 
274
 
339
 
Line -... Line 340...
-
 
340
 
-
 
341
 
275
 
342
align 4
276
 
343
PPPoE_start_connection:
Line 277... Line 344...
277
align 4
344
 
278
PPPoE_start_connection:
345
        DEBUGF  2,"PPPoE_start_connection: %x\n", cx
Line 293... Line 360...
293
 
360
 
294
 
361
 
Line -... Line 362...
-
 
362
align 4
-
 
363
PPPoE_stop_connection:
295
align 4
364
 
296
PPPoE_stop_connection:
365
        DEBUGF  2,"PPPoE_stop_connection\n"
297
 
366
 
298
        xor     eax, eax
367
        xor     eax, eax