
This is a low-level network debugging utility that utilizes raw packet i/o to construct and deconstruct tcp, udp, ipv4, arp, and icmp packets over ethernet.
Revision 3:c32d9660b888, committed 2010-10-12
- Comitter:
- etherealflaim
- Date:
- Tue Oct 12 06:14:19 2010 +0000
- Parent:
- 2:e8e09adc41fc
- Child:
- 4:88fc7fa58931
- Commit message:
- Documentation updates
Changed in this revision
--- a/net/arp.h Tue Oct 12 06:10:41 2010 +0000 +++ b/net/arp.h Tue Oct 12 06:14:19 2010 +0000 @@ -1,13 +1,13 @@ +/// ARP Packet + #ifndef ARP_H #define ARP_H #include "net.h" -/// \file ARP packet - #define ETHERTYPE_ARP 0x0806 -/// ARP Packet +/// ARP Packet memory map typedef struct { u16 hardware_type; ///< 0x0001 for ethernet u16 protocol_type; ///< 0x0800 for IPv4
--- a/net/ethernet.h Tue Oct 12 06:10:41 2010 +0000 +++ b/net/ethernet.h Tue Oct 12 06:14:19 2010 +0000 @@ -5,12 +5,12 @@ /// \file Ethernet frames -/// Ethernet MAC address +/// Ethernet MAC address memory map typedef struct { unsigned char octet[6]; ///< Individual octsts of the MAC address } Ethernet_MAC; -/// Memory map for Ethernet Frame Header (according to the Ethernet II Framing Standard) +/// Ethernet II Frame Header Memory map typedef struct { /// Destination MAC address (6 octets) Ethernet_MAC destination;
--- a/net/icmp.h Tue Oct 12 06:10:41 2010 +0000 +++ b/net/icmp.h Tue Oct 12 06:14:19 2010 +0000 @@ -9,7 +9,7 @@ #define ICMP_ECHO_REQUEST 0x08 #define IPPROTO_ICMP 0x01 -/// Memory map of ICMP packet +/// ICMP packet memory map typedef struct { u8 type; ///< type of ICMP message u8 code; ///< code number associated with certain message types
--- a/net/ip.h Tue Oct 12 06:10:41 2010 +0000 +++ b/net/ip.h Tue Oct 12 06:14:19 2010 +0000 @@ -13,7 +13,7 @@ unsigned char octet[4]; ///< Individual address octets } IP_Address; -/// Memory map of IP Packet - Some may not work (see comments) +/// IP Packet memory map typedef struct { /// 4 bits that contain the version, that specifies if it's an IPv4 or IPv6 packet, unsigned version:4; // Only 0x4 supported @@ -30,7 +30,7 @@ unsigned dont_fragment:1; unsigned more_follow:1; /// 13 bits that contain the fragment offset, a field to identify position of fragment within original packet - unsigned fragment_offset:13; ////// This and the ones above may not work properly due to endianness + unsigned fragment_offset:13; ///< This and the ones above may not work properly due to endianness /// 8 bits that contain the Time to live (TTL) which is the number of hops (router, computer or device along a network) the packet is allowed to pass before it dies (for example, a packet with a TTL of 16 will be allowed to go across 16 routers to get to its destination before it is discarded), unsigned ttl:8; /// 8 bits that contain the protocol (TCP, UDP, ICMP, etc...)
--- a/net/tcp.h Tue Oct 12 06:10:41 2010 +0000 +++ b/net/tcp.h Tue Oct 12 06:14:19 2010 +0000 @@ -7,7 +7,7 @@ #define IPPROTO_TCP 0x06 -/// TCP Segment Memory Map +/// TCP Segment memory map typedef struct { u16 source_port; ///< Source port (1-65535) u16 destination_port; ///< Destination port (1-65535)