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 6:66c4cd9073aa, committed 2010-10-12
- Comitter:
- etherealflaim
- Date:
- Tue Oct 12 06:46:22 2010 +0000
- Parent:
- 5:c56386b9fc33
- Child:
- 7:e34ae4c7eb79
- Commit message:
- File documentation updates
Changed in this revision
--- a/main.cpp Tue Oct 12 06:37:21 2010 +0000 +++ b/main.cpp Tue Oct 12 06:46:22 2010 +0000 @@ -10,6 +10,18 @@ #include <string> #include <queue> +/** + \file main.c + \brief This is the primary NetTool demo file. + + This file is the brains of the NetTool, utilizing the networking code + found in other files to do some basic network diagnostic stuff. + Note that for the nettool to connect to a computer, the computer has + to already have an IP configured on the interface, which usually + requires that the interface or connection be manually assigned an IP + address. +*/ + // The main logger (global scope) Sniffer sniffer; Log main_log;
--- a/net/ethernet.h Tue Oct 12 06:37:21 2010 +0000 +++ b/net/ethernet.h Tue Oct 12 06:46:22 2010 +0000 @@ -3,7 +3,13 @@ #include "net.h" -/// \file Ethernet frames +/** + \file ethernet.h + \brief Ethernet frame header + + This file contains the memory map and associated functions for Ethernet frame header + creation and deconstruction. +*/ /// Ethernet MAC address memory map typedef struct {
--- a/net/icmp.h Tue Oct 12 06:37:21 2010 +0000 +++ b/net/icmp.h Tue Oct 12 06:46:22 2010 +0000 @@ -3,7 +3,13 @@ #include "net.h" -/// \file ICMP Packet +/** + \file icmp.h + \brief ICMP frame header + + This file contains the memory map and associated functions for ICMP packet + creation and deconstruction. +*/ #define ICMP_ECHO_REPLY 0x00 #define ICMP_ECHO_REQUEST 0x08
--- a/net/ip.h Tue Oct 12 06:37:21 2010 +0000 +++ b/net/ip.h Tue Oct 12 06:46:22 2010 +0000 @@ -3,7 +3,13 @@ #include "net.h" -/// \file IP Packet +/** + \file ip.h + \brief IP Packet header + + This file contains the memory map and associated functions for IP packet header + creation and deconstruction. +*/ #define ETHERTYPE_IPV4 0x0800 #define ETHERTYPE_IPV6 0x86DD
--- a/net/tcp.h Tue Oct 12 06:37:21 2010 +0000 +++ b/net/tcp.h Tue Oct 12 06:46:22 2010 +0000 @@ -3,7 +3,13 @@ #include "net.h" -/// \file TCP Segment +/** + \file tcp.h + \brief TCP segment header + + This file contains the memory map and associated functions for TCP segment header + creation and deconstruction. +*/ #define IPPROTO_TCP 0x06
--- a/net/udp.h Tue Oct 12 06:37:21 2010 +0000 +++ b/net/udp.h Tue Oct 12 06:46:22 2010 +0000 @@ -3,7 +3,13 @@ #include "net.h" -/// \file UDP packet +/** + \file udp.h + \brief UDP packet + + This file contains the memory map and associated functions for UDP packet + creation and deconstruction. +*/ #define IPPROTO_UDP 0x11
--- a/scanner.h Tue Oct 12 06:37:21 2010 +0000 +++ b/scanner.h Tue Oct 12 06:46:22 2010 +0000 @@ -9,6 +9,15 @@ #include <cstring> #include <set> +/** + \file scanner.h + \brief Basic TCP Port Scanner + + The class in this file facilitates a very fast (3 second scan, 7 second wait) TCP port scan + of all ports from 1-65535, keeping and printing a list of all ports on which a TCP SYN/ACK + is received (which should indicate that the port is open and waiting for connections). +*/ + #define SCANNER_PADSIZE 0 #define SCANNER_FRAMESIZE (sizeof(Ethernet_FrameHeader) + sizeof(IP_PacketHeader) + sizeof(TCP_SegmentHeader) + SCANNER_PADSIZE)
--- a/sniffer.h Tue Oct 12 06:37:21 2010 +0000 +++ b/sniffer.h Tue Oct 12 06:46:22 2010 +0000 @@ -11,6 +11,14 @@ #include <cstring> #include <functional> +/** + \file sniffer.h + \brief Ethernet packet sniffer + + This file is the bread and butter of the NetTool; it processes and constructs ethernet frames + on a bitwise level. +*/ + template <class Arg1, class Arg2, class Result> class handler {
--- a/util/log.h Tue Oct 12 06:37:21 2010 +0000 +++ b/util/log.h Tue Oct 12 06:46:22 2010 +0000 @@ -6,6 +6,13 @@ #include "stdarg.h" #include "stdio.h" +/** + \file log.h + \brief Logging utilities + + This file contains logging utilities +*/ + #define LOG_BUFSIZE 4096 /// Enumeration used to enable/disable various serial lines in the logger
--- a/util/types.h Tue Oct 12 06:37:21 2010 +0000 +++ b/util/types.h Tue Oct 12 06:46:22 2010 +0000 @@ -1,6 +1,13 @@ #ifndef TYPES_H #define TYPES_H +/** + \file types.h + \brief Type definitions + + This file contains some utility type definitions +*/ + /// Unsigned 8 bit value typedef unsigned char u8;
--- a/util/util.h Tue Oct 12 06:37:21 2010 +0000 +++ b/util/util.h Tue Oct 12 06:46:22 2010 +0000 @@ -4,6 +4,14 @@ #include "types.h" #include "log.h" +/** + \file util.h + \brief Primary utility header + + In addition to providing some utility functions, this file also includes + the other utility headers automatically. +*/ + /// Is any byte memory at start for bytes nonzero? inline bool is_nonzero_mem(u8 *start, unsigned int bytes) {