summaryrefslogtreecommitdiff
path: root/src/kernel/kernel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/kernel.c')
-rw-r--r--src/kernel/kernel.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 7796d34..e431327 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -479,7 +479,7 @@ void handle_network_event( network_event_t *event, void *context )
network_ipv4_address_to_string( arp->destination_protocol_address, dst_ip, NETWORK_PROTOCOL_IPV4_ADDR_STRING );
printf( "ARP: hw src: %s, dst: %s, ip src: %s, dst: %s, oper: %d\n",
- src_mac_addr, dst_mac_addr, src_ip, dst_ip, arp->operation );
+ src_mac_addr, dst_mac_addr, src_ip, dst_ip, arp->operation >> 8 );
// TODO: remember the address mapping
@@ -495,6 +495,18 @@ void handle_network_event( network_event_t *event, void *context )
event->buf.length = sizeof( network_ethernet_packet_header_t ) + sizeof( network_arp_packet_t );
((network_vtable_t *)( global_context.network->base.vtable ))->send( global_context.network, event->buf );
+ } else if( packet->header.type == NETWORK_ETHER_PROTOCOL_TYPE_IPV4 ) {
+ network_ipv4_packet_t *ip = (network_ipv4_packet_t *)&packet->data;
+ char src_ip[NETWORK_PROTOCOL_IPV4_ADDR_STRING];
+ char dst_ip[NETWORK_PROTOCOL_IPV4_ADDR_STRING];
+ char protocol[NETWORK_PROTOCOL_IPV4_PROTOCOL_STRING];
+
+ network_ipv4_address_to_string( ip->source_address, src_ip, NETWORK_PROTOCOL_IPV4_ADDR_STRING );
+ network_ipv4_address_to_string( ip->destination_address, dst_ip, NETWORK_PROTOCOL_IPV4_ADDR_STRING );
+ network_ipv4_protocol_to_string( ip->protocol, protocol, NETWORK_PROTOCOL_IPV4_PROTOCOL_STRING );
+
+ printf( "IPV4: ip src: %s, dst: %s, protocol: %s (%d)\n",
+ src_ip, dst_ip, protocol, ip->protocol );
}
// we must free the data if we no longer need it