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... | |
#define ipv4_checksum | ( | ptr | ) |
#define ipv4_decrease_fragment_ttls |
--------------------------------------------------------------—; ; Decrease TimeToLive of all fragment slots ; ; --------------------------------------------------------------—;
#define ipv4_init |
--------------------------------------------------------------—; ; ipv4_init: Resets all IPv4 variables ; ; --------------------------------------------------------------—;
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: / ; ; --------------------------------------------------------------—;
dd dataptr |
dd headerlength |
dd headerptr |
rd IPv4_address |
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 ; ; --------------------------------------------------------------—;
rd IPv4_broadcast |
edi IPv4_checksum |
label ipv4_connect |
--------------------------------------------------------------—; ; ipv4_connect ; ; IN: eax = socket pointer ; ; OUT: eax = 0 on success ; eax = -1 on error ; ebx = error code on error ; ; --------------------------------------------------------------—;
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 ; ; --------------------------------------------------------------—;
rb IPv4_fragments |
rd IPv4_gateway |
label ipv4_get_frgmnt_num |
--------------------------------------------------------------—; ; ipv4_get_frgmnt_num ; ; IN: / ; ; OUT: ax = fragment number ; ; --------------------------------------------------------------—;
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: / ; ; --------------------------------------------------------------—;
rd IPv4_nameserver |
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 ; ; ---------------------------------------------------------------—;
label ipv4_output_raw |
---------------------------------------------------------------—; ; ipv4_output_raw ; ; IN: eax = socket ptr ; ecx = data length ; esi = data ptr ; ; OUT: eax = -1 on error ; ; ---------------------------------------------------------------—;
rd IPv4_packets_dumped |
rd IPv4_packets_rx |
rd IPv4_packets_tx |
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 ; ; --------------------------------------------------------------—;
rd IPv4_subnet |
dd offset |
dd remaining |
dd segmentsize |