Some markup changes in network stack.

git-svn-id: svn://kolibrios.org@2924 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2012-08-15 16:15:57 +00:00
parent a31be47dbc
commit 8140e5df69
7 changed files with 46 additions and 47 deletions

View File

@ -60,7 +60,7 @@ uglobal
NumARP dd ?
ARP_table rb ARP_TABLE_SIZE * sizeof.ARP_entry
ARP_table rb ARP_TABLE_SIZE * sizeof.ARP_entry ; TODO: separate ARP table and stats per interface
ARP_PACKETS_TX rd MAX_NET_DEVICES
ARP_PACKETS_RX rd MAX_NET_DEVICES

View File

@ -19,8 +19,6 @@
$Revision$
MAX_FRAGMENTS = 64
MAX_IP = MAX_NET_DEVICES
IP_MAX_INTERFACES = MAX_IP
struct IPv4_header
@ -60,14 +58,14 @@ ends
align 4
uglobal
IP_LIST rd MAX_IP
SUBNET_LIST rd MAX_IP
DNS_LIST rd MAX_IP
GATEWAY_LIST rd MAX_IP
BROADCAST_LIST rd MAX_IP
IP_LIST rd MAX_NET_DEVICES
SUBNET_LIST rd MAX_NET_DEVICES
DNS_LIST rd MAX_NET_DEVICES
GATEWAY_LIST rd MAX_NET_DEVICES
BROADCAST_LIST rd MAX_NET_DEVICES
IP_PACKETS_TX rd MAX_IP
IP_PACKETS_RX rd MAX_IP
IP_PACKETS_TX rd MAX_NET_DEVICES
IP_PACKETS_RX rd MAX_NET_DEVICES
FRAGMENT_LIST rb MAX_FRAGMENTS * sizeof.FRAGMENT_slot
endg
@ -84,7 +82,7 @@ macro IPv4_init {
xor eax, eax
mov edi, IP_LIST
mov ecx, 7*MAX_IP + (sizeof.FRAGMENT_slot*MAX_FRAGMENTS)/4
mov ecx, 7*MAX_NET_DEVICES + (sizeof.FRAGMENT_slot*MAX_FRAGMENTS)/4
rep stosd
}
@ -542,10 +540,8 @@ IPv4_find_fragment_slot:
.try_next:
add esi, sizeof.FRAGMENT_slot
loop .find_slot
; pop edx ebx
or esi, -1
; ret
or esi, -1
.found_slot:
pop edx ecx ebx eax
ret
@ -869,7 +865,7 @@ IPv4_dest_to_dev:
je .broadcast
xor edi, edi
mov ecx, MAX_IP
mov ecx, MAX_NET_DEVICES
.loop:
mov ebx, [IP_LIST+edi]
and ebx, [SUBNET_LIST+edi]

View File

@ -100,8 +100,8 @@ ends
align 4
uglobal
ICMP_PACKETS_TX rd MAX_IP
ICMP_PACKETS_RX rd MAX_IP
ICMP_PACKETS_TX rd MAX_NET_DEVICES
ICMP_PACKETS_RX rd MAX_NET_DEVICES
endg
@ -116,7 +116,7 @@ macro ICMP_init {
xor eax, eax
mov edi, ICMP_PACKETS_TX
mov ecx, 2*MAX_IP
mov ecx, 2*MAX_NET_DEVICES
rep stosd
}

View File

@ -118,7 +118,7 @@ struct TCP_SOCKET IP_SOCKET
requested_s_scale db ?
request_r_scale db ?
ts_recent dd ?
ts_recent dd ? ; a copy of the most-recent valid timestamp from the other end
ts_recent_age dd ?
last_ack_sent dd ?
@ -133,6 +133,7 @@ struct TCP_SOCKET IP_SOCKET
; extra
sendalot db ? ; also used as 'need output'
ts_ecr dd ? ; timestamp echo reply
ends

View File

@ -118,6 +118,8 @@ API_TCP = 4
API_ARP = 5
API_PPPOE = 6
HWACC_TCP_IPv4 = 1 shl 0
struct NET_DEVICE
type dd ? ; Type field

View File

@ -96,10 +96,10 @@ ends
align 4
uglobal
TCP_segments_tx rd IP_MAX_INTERFACES
TCP_segments_rx rd IP_MAX_INTERFACES
TCP_bytes_rx rq IP_MAX_INTERFACES
TCP_bytes_tx rq IP_MAX_INTERFACES
TCP_segments_tx rd MAX_NET_DEVICES
TCP_segments_rx rd MAX_NET_DEVICES
TCP_bytes_rx rq MAX_NET_DEVICES
TCP_bytes_tx rq MAX_NET_DEVICES
TCP_sequence_num dd ?
endg
@ -115,7 +115,7 @@ macro TCP_init {
xor eax, eax
mov edi, TCP_segments_tx
mov ecx, (6*IP_MAX_INTERFACES)
mov ecx, (6*MAX_NET_DEVICES)
rep stosd
pseudo_random eax

View File

@ -29,8 +29,8 @@ ends
align 4
uglobal
UDP_PACKETS_TX rd MAX_IP
UDP_PACKETS_RX rd MAX_IP
UDP_PACKETS_TX rd MAX_NET_DEVICES
UDP_PACKETS_RX rd MAX_NET_DEVICES
endg
@ -45,7 +45,7 @@ macro UDP_init {
xor eax, eax
mov edi, UDP_PACKETS_TX
mov ecx, 2*MAX_IP
mov ecx, 2*MAX_NET_DEVICES
rep stosd
}