KolibriOS kernel
stack.inc File Reference

Classes

struct  NET_DEVICE
 
struct  NET_BUFF
 

Macros

#define pseudo_random(reg)
 Exactly as it says.. More...
 
#define ntohd(reg)
 Network to Hardware byte order (dword) More...
 
#define ntohw(reg)
 Network to Hardware byte order (word) More...
 

Functions

void stack_handler_has_work ()
 Wakeup every tick. More...
 
void net_buff_alloc (arg_t buffersize)
 
void net_buff_free (arg_t buffer)
 

Variables

dd net_10ms
 
dw net_tmr_count
 
dd net_device_count
 
rd net_device_list
 
rd net_buffs_free
 list of pointers to actual net buffs More...
 
dd _current
 pointer to current element in net_buffs_free list More...
 
dd net_buffs_low
 actual net buff mem region start More...
 
dd net_buffs_high
 actual net buff mem region stop More...
 
label stack_init
 --------------------------------------------------------------—; ; stack_init: Initialize all network variables ; ; IN: / ; OUT: / ; ; --------------------------------------------------------------—; More...
 
label stack_handler
 --------------------------------------------------------------—; ; stack_handler: Network handlers called from os_loop. ; ; IN: / ; OUT: / ; ; --------------------------------------------------------------—; More...
 
label net_link_changed
 
label net_send_event
 
label net_add_device
 --------------------------------------------------------------—; ; net_add_device: Called by network driver to register interface. ; ; IN: ebx = ptr to device structure ; ; OUT: eax = device num on success ; eax = -1 on error ; ; --------------------------------------------------------------—; More...
 
label net_remove_device
 --------------------------------------------------------------—; ; net_remove_device: Called by network driver to unregister dev. ; ; IN: ebx = ptr to device ; ; OUT: eax: -1 on error ; ; --------------------------------------------------------------—; More...
 
label net_ptr_to_num
 --------------------------------------------------------------—; ; net_ptr_to_num ; ; IN: ebx = ptr to device struct ; ; OUT: edi = device number ; edi = -1 on error ; ; --------------------------------------------------------------—; More...
 
label net_ptr_to_num4
 Todo, place number in device structure so we only need to verify? More...
 
label checksum_1
 --------------------------------------------------------------—; ; checksum_1: Calculate semi-checksum for network packets. ; ; IN: edx = start offset for semi-checksum ; esi = pointer to data ; ecx = data size ; ; OUT: edx = semi-checksum ; ; --------------------------------------------------------------—; More...
 
label checksum_2
 --------------------------------------------------------------—; ; checksum_2: Calculate the final ip/tcp/udp checksum. ; ; IN: edx = semi-checksum ; ; OUT: dx = checksum (in INET byte order) ; ; --------------------------------------------------------------—; More...
 
label sys_network
 --------------------------------------------------------------—; ; System function 74: Low level access to network devices. ; ; --------------------------------------------------------------—; More...
 
label sys_protocols
 --------------------------------------------------------------—; ; System function 76: Low level access to protocol handlers. ; ; --------------------------------------------------------------—; More...
 

Macro Definition Documentation

◆ ntohd

#define ntohd (   reg)

Network to Hardware byte order (dword)

Source
network/stack.inc:225

◆ ntohw

#define ntohw (   reg)

Network to Hardware byte order (word)

Source
network/stack.inc:234

◆ pseudo_random

#define pseudo_random (   reg)

Exactly as it says..

Source
network/stack.inc:214

Function Documentation

◆ net_buff_alloc()

void net_buff_alloc ( arg_t  buffersize)

◆ net_buff_free()

void net_buff_free ( arg_t  buffer)

◆ stack_handler_has_work()

void stack_handler_has_work ( )

Wakeup every tick.

Source
network/stack.inc:346

Variable Documentation

◆ _current

dd _current

pointer to current element in net_buffs_free list

Initial value
?
Source
network/stack.inc:267

◆ checksum_1

label checksum_1

--------------------------------------------------------------—; ; checksum_1: Calculate semi-checksum for network packets. ; ; IN: edx = start offset for semi-checksum ; esi = pointer to data ; ecx = data size ; ; OUT: edx = semi-checksum ; ; --------------------------------------------------------------—;

Source
network/stack.inc:669

◆ checksum_2

label checksum_2

--------------------------------------------------------------—; ; checksum_2: Calculate the final ip/tcp/udp checksum. ; ; IN: edx = semi-checksum ; ; OUT: dx = checksum (in INET byte order) ; ; --------------------------------------------------------------—;

Source
network/stack.inc:747

◆ net_10ms

dd net_10ms
Initial value
?
Source
network/stack.inc:27

◆ net_add_device

label net_add_device

--------------------------------------------------------------—; ; net_add_device: Called by network driver to register interface. ; ; IN: ebx = ptr to device structure ; ; OUT: eax = device num on success ; eax = -1 on error ; ; --------------------------------------------------------------—;

Source
network/stack.inc:520

◆ net_buffs_free

rd net_buffs_free

list of pointers to actual net buffs

Initial value
NET_BUFFERS
Source
network/stack.inc:266

◆ net_buffs_high

dd net_buffs_high

actual net buff mem region stop

Initial value
?
Source
network/stack.inc:271

◆ net_buffs_low

dd net_buffs_low

actual net buff mem region start

Initial value
?
Source
network/stack.inc:270

◆ net_device_count

dd net_device_count
Initial value
?
Source
network/stack.inc:263

◆ net_device_list

rd net_device_list
Initial value
NET_DEVICES_MAX
Source
network/stack.inc:264

◆ net_link_changed

label net_link_changed

◆ net_ptr_to_num

label net_ptr_to_num

--------------------------------------------------------------—; ; net_ptr_to_num ; ; IN: ebx = ptr to device struct ; ; OUT: edi = device number ; edi = -1 on error ; ; --------------------------------------------------------------—;

Source
network/stack.inc:623

◆ net_ptr_to_num4

label net_ptr_to_num4

Todo, place number in device structure so we only need to verify?

Source
network/stack.inc:632

◆ net_remove_device

label net_remove_device

--------------------------------------------------------------—; ; net_remove_device: Called by network driver to unregister dev. ; ; IN: ebx = ptr to device ; ; OUT: eax: -1 on error ; ; --------------------------------------------------------------—;

Source
network/stack.inc:579

◆ net_send_event

label net_send_event

◆ net_tmr_count

dw net_tmr_count
Initial value
?
Source
network/stack.inc:28

◆ stack_handler

label stack_handler

--------------------------------------------------------------—; ; stack_handler: Network handlers called from os_loop. ; ; IN: / ; OUT: / ; ; --------------------------------------------------------------—;

Source
network/stack.inc:364

◆ stack_init

label stack_init

--------------------------------------------------------------—; ; stack_init: Initialize all network variables ; ; IN: / ; OUT: / ; ; --------------------------------------------------------------—;

Source
network/stack.inc:286

◆ sys_network

label sys_network

--------------------------------------------------------------—; ; System function 74: Low level access to network devices. ; ; --------------------------------------------------------------—;

Source
network/stack.inc:776

◆ sys_protocols

label sys_protocols

--------------------------------------------------------------—; ; System function 76: Low level access to protocol handlers. ; ; --------------------------------------------------------------—;

Source
network/stack.inc:937