Subversion Repositories Kolibri OS

Rev

Rev 7679 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7679 Rev 9049
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2012-2019. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2012-2021. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;  PPPoE.INC                                                   ;;
6
;;  PPPoE.INC                                                   ;;
7
;;                                                              ;;
7
;;                                                              ;;
8
;;  Part of the tcp/ip network stack for KolibriOS              ;;
8
;;  Part of the tcp/ip network stack for KolibriOS              ;;
Line 12... Line 12...
12
;;          GNU GENERAL PUBLIC LICENSE                          ;;
12
;;          GNU GENERAL PUBLIC LICENSE                          ;;
13
;;             Version 2, June 1991                             ;;
13
;;             Version 2, June 1991                             ;;
14
;;                                                              ;;
14
;;                                                              ;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
$Revision: 7679 $
17
$Revision: 9049 $
18
 
18
 
19
 
19
 
Line 139... Line 139...
139
        jne     .bad
139
        jne     .bad
Line 140... Line 140...
140
 
140
 
Line 141... Line 141...
141
        DEBUGF  DEBUG_NETWORK_VERBOSE, "PPPoE_discovery_output: device=%x\n", ebx
141
        DEBUGF  DEBUG_NETWORK_VERBOSE, "PPPoE_discovery_output: device=%x\n", ebx
142
 
-
 
143
; Create packet.
142
 
144
        push    ecx esi
-
 
145
;;;; FIXME        stdcall kernel_alloc, 1500
143
; Create packet.
146
        pop     esi ecx
144
        stdcall net_buff_alloc, 1514 + NET_BUFF.data
Line -... Line 145...
-
 
145
        test    eax, eax
-
 
146
        jz      .bad
-
 
147
 
-
 
148
; Net buffer header
-
 
149
        mov     [eax + NET_BUFF.type], NET_BUFF_ETH
-
 
150
        mov     [eax + NET_BUFF.device], ebx
147
        test    eax, eax
151
        mov     [eax + NET_BUFF.offset], NET_BUFF.data
148
        jz      .bad
152
 
149
 
153
; Packet data
Line -... Line 154...
-
 
154
        mov     edx, ecx
150
        mov     edx, ecx
155
        lea     edi, [eax + NET_BUFF.data]
151
        mov     edi, eax
156
        rep movsb
152
        rep movsb
157
 
153
 
158
; Packet size
-
 
159
        cmp     edx, 60
Line 154... Line -...
154
        cmp     edx, 60         ; Min ETH size
-
 
155
        ja      @f
-
 
156
        mov     edx, 60
160
        ja      @f
157
       @@:
-
 
158
 
161
        mov     edx, 60
-
 
162
  @@:
159
        push    edx eax         ; size and packet ptr for driver send proc
163
        mov     [eax + NET_BUFF.length], edx
160
 
164
 
-
 
165
; Overwrite ETH source MAC with our own
-
 
166
        lea     esi, [ebx + ETH_DEVICE.mac]
161
; Overwrite source MAC and protocol type
167
        lea     edi, [eax + NET_BUFF.data + ETH_header.SrcMAC]
162
        lea     edi, [eax + ETH_header.SrcMAC]
168
        movsd
163
        lea     esi, [ebx + ETH_DEVICE.mac]
169
        movsw
164
        movsd
-
 
165
        movsw
170
 
Line 166... Line 171...
166
        cmp     word[edi], ETHER_PROTO_PPP_SESSION      ; Allow only PPP_discovery, or LCP
171
; Allow only PPP_discovery, or LCP
167
        je      @f
172
        cmp     word[edi], ETHER_PROTO_PPP_SESSION
168
        mov     ax, ETHER_PROTO_PPP_DISCOVERY
-
 
169
        stosw
-
 
170
       @@:
173
        je      @f
Line 171... Line 174...
171
 
174
        mov     word[edi], ETHER_PROTO_PPP_DISCOVERY
172
; And send the packet
175
       @@:
173
        call    [ebx + NET_DEVICE.transmit]
176