All comments in the library, bootloaders, demos and projects have now been spell-checked and spelling mistakes/typos corrected.
This commit is contained in:
parent
fb3fcb968e
commit
6933f2e1a5
95 changed files with 274 additions and 273 deletions
|
|
@ -41,7 +41,7 @@
|
|||
* to the output Ethernet frame if the host is requesting the IP or MAC address of the
|
||||
* virtual server device on the network.
|
||||
*
|
||||
* \param InDataStart Pointer to the start of the incomming packet's ARP header
|
||||
* \param InDataStart Pointer to the start of the incoming packet's ARP header
|
||||
* \param OutDataStart Pointer to the start of the outgoing packet's ARP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
/** Processes a DHCP packet inside an Ethernet frame, and writes the appropriate response
|
||||
* to the output Ethernet frame if the host is requesting or accepting an IP address.
|
||||
*
|
||||
* \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
|
||||
* \param DHCPHeaderInStart Pointer to the start of the incomming packet's DHCP header
|
||||
* \param IPHeaderInStart Pointer to the start of the incoming packet's IP header
|
||||
* \param DHCPHeaderInStart Pointer to the start of the incoming packet's DHCP header
|
||||
* \param DHCPHeaderOutStart Pointer to the start of the outgoing packet's DHCP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
|
|
@ -72,12 +72,12 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, v
|
|||
memcpy(&DHCPHeaderOUT->ClientHardwareAddress, &DHCPHeaderIN->ClientHardwareAddress, sizeof(MAC_Address_t));
|
||||
DHCPHeaderOUT->Cookie = SwapEndian_32(DHCP_MAGIC_COOKIE);
|
||||
|
||||
/* Alter the incomming IP packet header so that the corrected IP source and destinations are used - this means that
|
||||
/* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that
|
||||
when the response IP header is generated, it will use the corrected addresses and not the null/broatcast addresses */
|
||||
IPHeaderIN->SourceAddress = ClientIPAddress;
|
||||
IPHeaderIN->DestinationAddress = ServerIPAddress;
|
||||
|
||||
/* Process the incomming DHCP packet options */
|
||||
/* Process the incoming DHCP packet options */
|
||||
while (DHCPOptionsINStart[0] != DHCP_OPTION_END)
|
||||
{
|
||||
/* Find the Message Type DHCP option, to determine the type of DHCP packet */
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@
|
|||
uint8_t HardwareAddressLength; /**< Length in bytes of a hardware (MAC) address on the network */
|
||||
uint8_t Hops; /**< Number of hops required to reach the server, unused */
|
||||
|
||||
uint32_t TransactionID; /**< Unique ID of the DHCP packet, for postive matching between sent and recieved packets */
|
||||
uint32_t TransactionID; /**< Unique ID of the DHCP packet, for positive matching between sent and received packets */
|
||||
|
||||
uint16_t ElapsedSeconds; /**< Elapsed seconds since the request was made */
|
||||
uint16_t Flags; /**< BOOTP packet flags */
|
||||
|
|
|
|||
|
|
@ -216,7 +216,7 @@ USB_Descriptor_String_t PROGMEM ProductString =
|
|||
|
||||
/** This function is called by the library when in device mode, and must be overridden (see StdDescriptors.h
|
||||
* documentation) by the application code so that the address and size of a requested descriptor can be given
|
||||
* to the USB library. When the device recieves a Get Descriptor request on the control endpoint, this function
|
||||
* to the USB library. When the device receives a Get Descriptor request on the control endpoint, this function
|
||||
* is called so that the descriptor details can be passed back and the appropriate descriptor sent back to the
|
||||
* USB host.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@
|
|||
/** \file
|
||||
*
|
||||
* Ethernet frame packet handling routines. This protocol handles the processing of raw Ethernet
|
||||
* frames sent and receieved, deferring the processing of subpacket protocols to the appropriate
|
||||
* frames sent and received, deferring the processing of subpacket protocols to the appropriate
|
||||
* protocol handlers, such as DHCP or ARP.
|
||||
*/
|
||||
|
||||
#include "Ethernet.h"
|
||||
|
||||
/* Global Variables: */
|
||||
/** Ethernet Frame buffer structure, to hold the incomming Ethernet frame from the host. */
|
||||
/** Ethernet Frame buffer structure, to hold the incoming Ethernet frame from the host. */
|
||||
Ethernet_Frame_Info_t FrameIN;
|
||||
|
||||
/** Ethernet Frame buffer structure, to hold the outgoing Ethernet frame to the host. */
|
||||
|
|
@ -60,14 +60,14 @@ const IP_Address_t BroadcastIPAddress = {BROADCAST_IP_ADDRESS};
|
|||
const IP_Address_t ClientIPAddress = {CLIENT_IP_ADDRESS};
|
||||
|
||||
|
||||
/** Processes an incomming Ethernet frame, and writes the appropriate response to the output Ethernet
|
||||
/** Processes an incoming Ethernet frame, and writes the appropriate response to the output Ethernet
|
||||
* frame buffer if the sub protocol handlers create a valid response.
|
||||
*/
|
||||
void Ethernet_ProcessPacket(void)
|
||||
{
|
||||
DecodeEthernetFrameHeader(FrameIN.FrameData);
|
||||
|
||||
/* Cast the incomming Ethernet frame to the Ethernet header type */
|
||||
/* Cast the incoming Ethernet frame to the Ethernet header type */
|
||||
Ethernet_Frame_Header_t* FrameINHeader = (Ethernet_Frame_Header_t*)&FrameIN.FrameData;
|
||||
Ethernet_Frame_Header_t* FrameOUTHeader = (Ethernet_Frame_Header_t*)&FrameOUT.FrameData;
|
||||
|
||||
|
|
@ -91,7 +91,7 @@ void Ethernet_ProcessPacket(void)
|
|||
break;
|
||||
}
|
||||
|
||||
/* Protcol processing routine has filled a response, complete the ethernet frame header */
|
||||
/* Protocol processing routine has filled a response, complete the ethernet frame header */
|
||||
if (RetSize > 0)
|
||||
{
|
||||
/* Fill out the response Ethernet frame header */
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
*/
|
||||
#define MAC_COMPARE(MAC1, MAC2) (memcmp(MAC1, MAC2, sizeof(MAC_Address_t)) == 0)
|
||||
|
||||
/** Maximum size of an incomming or outgoing Ethernet frame in bytes */
|
||||
/** Maximum size of an incoming or outgoing Ethernet frame in bytes */
|
||||
#define ETHERNET_FRAME_SIZE_MAX 1500
|
||||
|
||||
/** Minimum size of an Ethernet packet in bytes, to conform to the Ethernet V2 packet standard */
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
/** Processes an ICMP packet inside an Ethernet frame, and writes the appropriate response
|
||||
* to the output Ethernet frame if the host is issuing a ICMP ECHO request.
|
||||
*
|
||||
* \param InDataStart Pointer to the start of the incomming packet's ICMP header
|
||||
* \param InDataStart Pointer to the start of the incoming packet's ICMP header
|
||||
* \param OutDataStart Pointer to the start of the outgoing packet's ICMP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
/** Processes an IP packet inside an Ethernet frame, and writes the appropriate response
|
||||
* to the output Ethernet frame if one is created by a subprotocol handler.
|
||||
*
|
||||
* \param InDataStart Pointer to the start of the incomming packet's IP header
|
||||
* \param InDataStart Pointer to the start of the incoming packet's IP header
|
||||
* \param OutDataStart Pointer to the start of the outgoing packet's IP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
/** Protocol IP address of the virtual server machine */
|
||||
#define SERVER_IP_ADDRESS { 10, 0, 0, 2}
|
||||
|
||||
/** Protocol IP address of the broadcase address */
|
||||
/** Protocol IP address of the broadcast address */
|
||||
#define BROADCAST_IP_ADDRESS {0xFF, 0xFF, 0xFF, 0xFF}
|
||||
|
||||
/** Default Time To Live (TTL) value for sent packets, indicating the maximum allowable hops until their destination is reached */
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
uint8_t TypeOfService; /**< Special service type identifier, indicating delay/throughput/reliability levels */
|
||||
uint16_t TotalLength; /**< Total length of the IP packet, in bytes */
|
||||
|
||||
uint16_t Identification; /**< Idenfication value for identifying fragmented packets */
|
||||
uint16_t Identification; /**< Identification value for identifying fragmented packets */
|
||||
unsigned int FragmentOffset : 13; /**< Offset of this IP fragment */
|
||||
unsigned int Flags : 3; /**< Fragment flags, to indicate if a packet is fragmented */
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
/* Protocol decoders for Ethernet, TCP, IP, ICMP and ARP. Each of these routines
|
||||
accepts a header to the appropriate protocol and prints out pertient information
|
||||
accepts a header to the appropriate protocol and prints out pertinent information
|
||||
on the packet through the serial port.
|
||||
|
||||
To disable printing of a specific protocol, define the token NO_DECODE_{Protocol}
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
/** \file
|
||||
*
|
||||
* Protocol decoding routines, for the plain-text decoding of Ethernet frames for debugging purposes.
|
||||
* Enabled protocol decoders will print incomming Ethernet frame contents through the USART in a human
|
||||
* Enabled protocol decoders will print incoming Ethernet frame contents through the USART in a human
|
||||
* readable format.
|
||||
*
|
||||
* Note that the USART is a slow transmission medium, and will slow down packet processing considerably.
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@
|
|||
#include "Ethernet.h"
|
||||
|
||||
/* Macros: */
|
||||
/** Physical MAC Address of the USB netowork adapter */
|
||||
/** Physical MAC Address of the USB network adapter */
|
||||
#define ADAPTER_MAC_ADDRESS {0x02, 0x00, 0x02, 0x00, 0x02, 0x00}
|
||||
|
||||
/** Implemented RNDIS Version Major */
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ EVENT_HANDLER(USB_Connect)
|
|||
}
|
||||
|
||||
/** Event handler for the USB_Disconnect event. This indicates that the device is no longer connected to a host via
|
||||
* the status LEDs and stops all the relevent tasks.
|
||||
* the status LEDs and stops all the relevant tasks.
|
||||
*/
|
||||
EVENT_HANDLER(USB_Disconnect)
|
||||
{
|
||||
|
|
@ -114,7 +114,7 @@ EVENT_HANDLER(USB_Disconnect)
|
|||
}
|
||||
|
||||
/** Event handler for the USB_ConfigurationChanged event. This is fired when the host sets the current configuration
|
||||
* of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevent tasks.
|
||||
* of the USB device after enumeration, and configures the RNDIS device endpoints and starts the relevant tasks.
|
||||
*/
|
||||
EVENT_HANDLER(USB_ConfigurationChanged)
|
||||
{
|
||||
|
|
@ -238,7 +238,7 @@ void UpdateStatus(uint8_t CurrentStatus)
|
|||
}
|
||||
|
||||
/** Task to manage the sending and receiving of encapsulated RNDIS data and notifications. This removes the RNDIS
|
||||
* wrapper from recieved Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper
|
||||
* wrapper from received Ethernet frames and places them in the FrameIN global buffer, or adds the RNDIS wrapper
|
||||
* to a frame in the FrameOUT global before sending the buffer contents to the host.
|
||||
*/
|
||||
TASK(RNDIS_Task)
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ TASK(TCP_Task)
|
|||
{
|
||||
/* Task to hand off TCP packets to and from the listening applications. */
|
||||
|
||||
/* Run each application in sequence, to process incomming and generate outgoing packets */
|
||||
/* Run each application in sequence, to process incoming and generate outgoing packets */
|
||||
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
|
||||
{
|
||||
/* Find the corresponding port entry in the port table */
|
||||
|
|
@ -179,7 +179,7 @@ void TCP_Init(void)
|
|||
*/
|
||||
bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_ConnectionState_t*, TCP_ConnectionBuffer_t*))
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplfy network code */
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
/* Check to see if the port entry is already in the port state table */
|
||||
for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
|
||||
|
|
@ -226,7 +226,7 @@ bool TCP_SetPortState(uint16_t Port, uint8_t State, void (*Handler)(TCP_Connecti
|
|||
*/
|
||||
uint8_t TCP_GetPortState(uint16_t Port)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplfy network code */
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
for (uint8_t PTableEntry = 0; PTableEntry < MAX_TCP_CONNECTIONS; PTableEntry++)
|
||||
{
|
||||
|
|
@ -251,7 +251,7 @@ uint8_t TCP_GetPortState(uint16_t Port)
|
|||
*/
|
||||
bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort, uint8_t State)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplfy network code */
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
|
||||
{
|
||||
|
|
@ -291,7 +291,7 @@ bool TCP_SetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t
|
|||
*/
|
||||
uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplfy network code */
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
|
||||
{
|
||||
|
|
@ -318,7 +318,7 @@ uint8_t TCP_GetConnectionState(uint16_t Port, IP_Address_t RemoteAddress, uint16
|
|||
*/
|
||||
TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAddress, uint16_t RemotePort)
|
||||
{
|
||||
/* Note, Port number should be specified in BIG endian to simplfy network code */
|
||||
/* Note, Port number should be specified in BIG endian to simplify network code */
|
||||
|
||||
for (uint8_t CSTableEntry = 0; CSTableEntry < MAX_TCP_CONNECTIONS; CSTableEntry++)
|
||||
{
|
||||
|
|
@ -337,8 +337,8 @@ TCP_ConnectionInfo_t* TCP_GetConnectionInfo(uint16_t Port, IP_Address_t RemoteAd
|
|||
/** Processes a TCP packet inside an Ethernet frame, and writes the appropriate response
|
||||
* to the output Ethernet frame if one is created by a application handler.
|
||||
*
|
||||
* \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
|
||||
* \param TCPHeaderInStart Pointer to the start of the incomming packet's TCP header
|
||||
* \param IPHeaderInStart Pointer to the start of the incoming packet's IP header
|
||||
* \param TCPHeaderInStart Pointer to the start of the incoming packet's TCP header
|
||||
* \param TCPHeaderOutStart Pointer to the start of the outgoing packet's TCP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE if no
|
||||
|
|
@ -357,7 +357,7 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
|
|||
|
||||
bool PacketResponse = false;
|
||||
|
||||
/* Check if the destination port is open and allows incomming connections */
|
||||
/* Check if the destination port is open and allows incoming connections */
|
||||
if (TCP_GetPortState(TCPHeaderIN->DestinationPort) == TCP_Port_Open)
|
||||
{
|
||||
/* Detect SYN from host to start a connection */
|
||||
|
|
@ -375,7 +375,7 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Process the incomming TCP packet based on the current connection state for the sender and port */
|
||||
/* Process the incoming TCP packet based on the current connection state for the sender and port */
|
||||
switch (TCP_GetConnectionState(TCPHeaderIN->DestinationPort, IPHeaderIN->SourceAddress, TCPHeaderIN->SourcePort))
|
||||
{
|
||||
case TCP_Connection_Listen:
|
||||
|
|
@ -470,7 +470,7 @@ int16_t TCP_ProcessTCPPacket(void* IPHeaderInStart, void* TCPHeaderInStart, void
|
|||
}
|
||||
else
|
||||
{
|
||||
/* Buffer is currently in use by the application, defer processing of the incomming packet */
|
||||
/* Buffer is currently in use by the application, defer processing of the incoming packet */
|
||||
return NO_PROCESS;
|
||||
}
|
||||
}
|
||||
|
|
@ -591,7 +591,7 @@ static uint16_t TCP_Checksum16(void* TCPHeaderOutStart, IP_Address_t SourceAddre
|
|||
{
|
||||
uint32_t Checksum = 0;
|
||||
|
||||
/* TCP/IP checksums are the addition of the one's compliment of each word including the IP psudo-header,
|
||||
/* TCP/IP checksums are the addition of the one's compliment of each word including the IP pseudo-header,
|
||||
complimented */
|
||||
|
||||
Checksum += ((uint16_t*)&SourceAddress)[0];
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@
|
|||
unsigned char Reserved : 4; /**< Reserved, must be all 0 */
|
||||
unsigned char DataOffset : 4; /**< Offset of the data from the start of the header, in 4 byte chunks */
|
||||
uint8_t Flags; /**< TCP packet flags */
|
||||
uint16_t WindowSize; /**< Current data window size (bytes remaning in reception buffer) */
|
||||
uint16_t WindowSize; /**< Current data window size (bytes remaining in reception buffer) */
|
||||
|
||||
uint16_t Checksum; /**< TCP checksum */
|
||||
uint16_t UrgentPointer; /**< Urgent data pointer */
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
/** Processes a UDP packet inside an Ethernet frame, and writes the appropriate response
|
||||
* to the output Ethernet frame if a subprotocol handler has created a response packet.
|
||||
*
|
||||
* \param IPHeaderInStart Pointer to the start of the incomming packet's IP header
|
||||
* \param UDPHeaderInStart Pointer to the start of the incomming packet's UDP header
|
||||
* \param IPHeaderInStart Pointer to the start of the incoming packet's IP header
|
||||
* \param UDPHeaderInStart Pointer to the start of the incoming packet's UDP header
|
||||
* \param UDPHeaderOutStart Pointer to the start of the outgoing packet's UDP header
|
||||
*
|
||||
* \return The number of bytes written to the out Ethernet frame if any, NO_RESPONSE otherwise
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue