KolibriOS kernel
IPv4.inc File Reference

Classes

struct  IPv4_header
 
struct  IPv4_FRAGMENT_slot
 
struct  IPv4_FRAGMENT_entry
 This structure will replace the ethernet header in fragmented ip packets. More...
 

Macros

#define ipv4_init
 --------------------------------------------------------------—; ; ipv4_init: Resets all IPv4 variables ; ; --------------------------------------------------------------—; More...
 
#define ipv4_decrease_fragment_ttls
 --------------------------------------------------------------—; ; Decrease TimeToLive of all fragment slots ; ; --------------------------------------------------------------—; More...
 
#define ipv4_checksum(ptr)
 

Functions

void ipv4_fragment (arg_t buffer)
 --------------------------------------------------------------—; ; ipv4_fragment ; ; IN: [esp] = ptr to packet buffer to fragment ; edi = ptrr to ip header in that buffer ; ebx = device ptr ; ; OUT: / ; ; --------------------------------------------------------------—; More...
 

Variables

rd IPv4_address
 
rd IPv4_subnet
 
rd IPv4_nameserver
 
rd IPv4_gateway
 
rd IPv4_broadcast
 
rd IPv4_packets_tx
 
rd IPv4_packets_rx
 
rd IPv4_packets_dumped
 
rb IPv4_fragments
 
label ipv4_input
 --------------------------------------------------------------—; ; ipv4_input: Check if IPv4 Packet isnt damaged and call ; appropriate handler. (TCP/UDP/ICMP/..) ; We will also re-construct fragmented packets. ; ; IN: Pointer to buffer in [esp] ; pointer to device struct in ebx ; pointer to IPv4 header in edx ; size of IPv4 packet in ecx ; ; OUT: / ; ; --------------------------------------------------------------—; More...
 
label ipv4_find_fragment_slot
 --------------------------------------------------------------—; ; ipv4_find_fragment_slot ; ; IN: pointer to fragmented packet in edx ; ; OUT: pointer to slot in esi, -1 on error ; ; --------------------------------------------------------------—; More...
 
label ipv4_output
 ---------------------------------------------------------------—; ; ipv4_output ; ; IN: al = protocol ; ah = TTL ; ebx = device ptr (or 0 to let IP layer decide) ; ecx = data length ; edx = Source IP ; edi = Destination IP ; ; OUT: eax = pointer to buffer start ; eax = 0 on error ; ebx = device ptr (send packet through this device) ; ecx = data length ; edx = size of complete frame ; edi = start of IPv4 payload ; ; ---------------------------------------------------------------—; More...
 
label ipv4_output_raw
 ---------------------------------------------------------------—; ; ipv4_output_raw ; ; IN: eax = socket ptr ; ecx = data length ; esi = data ptr ; ; OUT: eax = -1 on error ; ; ---------------------------------------------------------------—; More...
 
dd offset
 
dd headerlength
 
dd headerptr
 
dd dataptr
 
dd remaining
 
dd segmentsize
 
edi IPv4_checksum
 Send the fragment. More...
 
label ipv4_route
 --------------------------------------------------------------—; ; ipv4_route ; ; IN: eax = Destination IP ; ebx = outgoing device / 0 ; edx = Source IP ; ; OUT: eax = Destination IP (may be gateway), 0 on error ; edx = Source IP ; edi = device number*4 ; ; DESTROYED: ; ecx ; ; --------------------------------------------------------------—; More...
 
label ipv4_get_frgmnt_num
 --------------------------------------------------------------—; ; ipv4_get_frgmnt_num ; ; IN: / ; ; OUT: ax = fragment number ; ; --------------------------------------------------------------—; More...
 
label ipv4_connect
 --------------------------------------------------------------—; ; ipv4_connect ; ; IN: eax = socket pointer ; ; OUT: eax = 0 on success ; eax = -1 on error ; ebx = error code on error ; ; --------------------------------------------------------------—; More...
 
label ipv4_api
 --------------------------------------------------------------—; ; ipv4_API: Part of system function 76. ; ; IN: bl = subfunction number ; bh = device number ; ecx, edx, .. depends on subfunction ; ; OUT: depends on subfunction ; ; --------------------------------------------------------------—; More...
 

Macro Definition Documentation

◆ ipv4_checksum

#define ipv4_checksum (   ptr)

◆ ipv4_decrease_fragment_ttls

#define ipv4_decrease_fragment_ttls

--------------------------------------------------------------—; ; Decrease TimeToLive of all fragment slots ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:113

◆ ipv4_init

#define ipv4_init

--------------------------------------------------------------—; ; ipv4_init: Resets all IPv4 variables ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:98

Function Documentation

◆ ipv4_fragment()

void ipv4_fragment ( arg_t  buffer)

--------------------------------------------------------------—; ; ipv4_fragment ; ; IN: [esp] = ptr to packet buffer to fragment ; edi = ptrr to ip header in that buffer ; ebx = device ptr ; ; OUT: / ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:832

Variable Documentation

◆ dataptr

dd dataptr
Initial value
?
Source
network/IPv4.inc:838

◆ headerlength

dd headerlength
Initial value
?
Source
network/IPv4.inc:836

◆ headerptr

dd headerptr
Initial value
?
Source
network/IPv4.inc:837

◆ IPv4_address

rd IPv4_address
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:76

◆ ipv4_api

label ipv4_api

--------------------------------------------------------------—; ; ipv4_API: Part of system function 76. ; ; IN: bl = subfunction number ; bh = device number ; ecx, edx, .. depends on subfunction ; ; OUT: depends on subfunction ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:1088

◆ IPv4_broadcast

rd IPv4_broadcast
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:80

◆ IPv4_checksum

edi IPv4_checksum

Send the fragment.

Initial value
Source
network/IPv4.inc:923

◆ ipv4_connect

label ipv4_connect

--------------------------------------------------------------—; ; ipv4_connect ; ; IN: eax = socket pointer ; ; OUT: eax = 0 on success ; eax = -1 on error ; ebx = error code on error ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:1052

◆ ipv4_find_fragment_slot

label ipv4_find_fragment_slot

--------------------------------------------------------------—; ; ipv4_find_fragment_slot ; ; IN: pointer to fragmented packet in edx ; ; OUT: pointer to slot in esi, -1 on error ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:599

◆ IPv4_fragments

rb IPv4_fragments
Initial value
IPv4_MAX_FRAGMENTS * sizeof.IPv4_FRAGMENT_slot
Source
network/IPv4.inc:86

◆ IPv4_gateway

rd IPv4_gateway
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:79

◆ ipv4_get_frgmnt_num

label ipv4_get_frgmnt_num

--------------------------------------------------------------—; ; ipv4_get_frgmnt_num ; ; IN: / ; ; OUT: ax = fragment number ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:1034

◆ ipv4_input

label ipv4_input

--------------------------------------------------------------—; ; ipv4_input: Check if IPv4 Packet isnt damaged and call ; appropriate handler. (TCP/UDP/ICMP/..) ; We will also re-construct fragmented packets. ; ; IN: Pointer to buffer in [esp] ; pointer to device struct in ebx ; pointer to IPv4 header in edx ; size of IPv4 packet in ecx ; ; OUT: / ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:219

◆ IPv4_nameserver

rd IPv4_nameserver
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:78

◆ ipv4_output

label ipv4_output

---------------------------------------------------------------—; ; ipv4_output ; ; IN: al = protocol ; ah = TTL ; ebx = device ptr (or 0 to let IP layer decide) ; ecx = data length ; edx = Source IP ; edi = Destination IP ; ; OUT: eax = pointer to buffer start ; eax = 0 on error ; ebx = device ptr (send packet through this device) ; ecx = data length ; edx = size of complete frame ; edi = start of IPv4 payload ; ; ---------------------------------------------------------------—;

Source
network/IPv4.inc:646

◆ ipv4_output_raw

label ipv4_output_raw

---------------------------------------------------------------—; ; ipv4_output_raw ; ; IN: eax = socket ptr ; ecx = data length ; esi = data ptr ; ; OUT: eax = -1 on error ; ; ---------------------------------------------------------------—;

Source
network/IPv4.inc:752

◆ IPv4_packets_dumped

rd IPv4_packets_dumped
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:84

◆ IPv4_packets_rx

rd IPv4_packets_rx
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:83

◆ IPv4_packets_tx

rd IPv4_packets_tx
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:82

◆ ipv4_route

label ipv4_route

--------------------------------------------------------------—; ; ipv4_route ; ; IN: eax = Destination IP ; ebx = outgoing device / 0 ; edx = Source IP ; ; OUT: eax = Destination IP (may be gateway), 0 on error ; edx = Source IP ; edi = device number*4 ; ; DESTROYED: ; ecx ; ; --------------------------------------------------------------—;

Source
network/IPv4.inc:958

◆ IPv4_subnet

rd IPv4_subnet
Initial value
NET_DEVICES_MAX
Source
network/IPv4.inc:77

◆ offset

dd offset
Initial value
?
Source
network/IPv4.inc:835

◆ remaining

dd remaining
Initial value
?
Source
network/IPv4.inc:839

◆ segmentsize

dd segmentsize
Initial value
?
Source
network/IPv4.inc:840